bool Manager::prepare(bool silent) { knowledge.reasolveDependency(strAppName.c_str(), bAutoDependancy, silent); clearExecutables(); connections.clear(); modules.clear(); resources.clear(); connections = knowledge.getSelConnection(); modules = knowledge.getSelModules(); resources = knowledge.getSelResources(); /** * we need to initialize a module with a local broker if the * host property is set to "localhost". * * TODO: Resources should also be added to the relevant executable. up to now * all of them will be handled by manager. */ ModulePIterator itr; int id = 0; for(itr=modules.begin(); itr!=modules.end(); itr++) { Broker* broker = createBroker(*itr); Executable* exe = new Executable(broker, (MEvent*)this, bWithWatchDog); exe->setID(id++); exe->setCommand((*itr)->getName()); exe->setParam((*itr)->getParam()); exe->setHost((*itr)->getHost()); exe->setStdio((*itr)->getStdio()); exe->setWorkDir((*itr)->getWorkDir()); exe->setPostExecWait((*itr)->getPostExecWait()); string env = string("YARP_PORT_PREFIX=") + string((*itr)->getPrefix()); exe->setEnv(env.c_str()); /** * Adding connections to their owners * TODO: check whether this is still needed or not */ //CnnIterator cnn; //for(cnn=connections.begin(); cnn!=connections.end(); cnn++) // if((*cnn).owner() == (*itr)) // exe->addConnection(*cnn); /** * Adding resources to their owners */ for(unsigned int i=0; i<resources.size(); i++) { ResYarpPort* res = dynamic_cast<ResYarpPort*>(resources[i]); if(res && (res->owner() == (*itr))) exe->addResource(*res); } runnables.push_back(exe); } return true; }