Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ReplicatedActorClassBase.cpp')
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ReplicatedActorClassBase.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ReplicatedActorClassBase.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ReplicatedActorClassBase.cpp
index fc9747cc0..923a327eb 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ReplicatedActorClassBase.cpp
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ReplicatedActorClassBase.cpp
@@ -14,33 +14,35 @@
namespace etRuntime {
-ReplicatedActorClassBase::ReplicatedActorClassBase(IRTObject* parent, const std::string& name) :
+ReplicatedActorClassBase::ReplicatedActorClassBase(IRTObject* parent, const String& name) :
RTObject(parent, name), m_items() {
}
ReplicatedActorClassBase::~ReplicatedActorClassBase() {
- for(std::vector<ActorClassBase*>::iterator it = m_items.begin(); it != m_items.end(); ++it) {
+ for(Vector<ActorClassBase*>::iterator it = m_items.begin(); it != m_items.end(); ++it) {
delete *it;
}
}
void ReplicatedActorClassBase::createSubActors(int number) {
+ m_items.reserve(m_items.size() + number);
+
for (int i = 0; i < number; i++) {
- std::stringstream itemName;
- itemName << getName() << SEP << i;
- ActorClassBase* item = createActor(getParent(), itemName.str());
+ char buffer[64];
+ sprintf(buffer, "%s%c%d", getName().c_str(), SEP, i);
+ ActorClassBase* item = createActor(getParent(), buffer);
m_items.push_back(item);
}
}
void ReplicatedActorClassBase::initialize() {
- for(std::vector<ActorClassBase*>::iterator it = m_items.begin(); it != m_items.end(); ++it) {
+ for(Vector<ActorClassBase*>::iterator it = m_items.begin(); it != m_items.end(); ++it) {
(*it)->initialize();
}
}
void ReplicatedActorClassBase::setProbesActive(bool recursive, bool active) {
- for(std::vector<ActorClassBase*>::iterator it = m_items.begin(); it != m_items.end(); ++it)
+ for(Vector<ActorClassBase*>::iterator it = m_items.begin(); it != m_items.end(); ++it)
(*it)->setProbesActive(recursive, active);
}

Back to the top