Skip to main content
summaryrefslogtreecommitdiffstats
blob: fc9747cc07e56117510e7b2da447fc1fac6d51a5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*******************************************************************************
 * Copyright (c) 2016 protos software gmbh (http://www.protos.de).
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * CONTRIBUTORS:
 * 		Jan Belle (initial contribution)
 *
 *******************************************************************************/

#include "ReplicatedActorClassBase.h"

namespace etRuntime {

ReplicatedActorClassBase::ReplicatedActorClassBase(IRTObject* parent, const std::string& name) :
		RTObject(parent, name), m_items() {
}

ReplicatedActorClassBase::~ReplicatedActorClassBase() {
	for(std::vector<ActorClassBase*>::iterator it = m_items.begin(); it != m_items.end(); ++it) {
		delete *it;
	}
}

void ReplicatedActorClassBase::createSubActors(int number) {
	for (int i = 0; i < number; i++) {
		std::stringstream itemName;
		itemName << getName() << SEP << i;
		ActorClassBase* item = createActor(getParent(), itemName.str());
		m_items.push_back(item);
	}
}

void ReplicatedActorClassBase::initialize() {
	for(std::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)
			(*it)->setProbesActive(recursive, active);
}

} // namespace etRuntime

Back to the top