29 #ifndef OCL_DEPLOYMENTCOMPONENT_HPP 30 #define OCL_DEPLOYMENTCOMPONENT_HPP 114 : instance(0), act(0), loaded(false), loadedProperties(false),
115 autostart(false), autoconf(false),
116 autoconnect(false), autosave(false),
117 proxy(false), server(false),
154 typedef std::vector<RTT::base::PortInterface*>
Ports;
155 typedef std::vector<RTT::TaskContext*>
Owners;
164 typedef std::map<std::string, ConnectionData>
ConMap;
170 typedef std::map<std::string, ComponentData>
CompMap;
181 bool configureHook();
187 bool unloadComponentImpl( CompMap::iterator cit );
296 const bool ignoreNonexistentPorts);
313 bool createDataPortConnections(
const bool skipUnconnected);
333 bool connectPorts(
const std::string& one,
const std::string& other);
350 bool connectPorts(
const std::string& one,
const std::string& one_port,
351 const std::string& other,
const std::string& other_port);
363 bool connect(
const std::string& one,
const std::string& other,
ConnPolicy policy);
372 bool stream(
const std::string& port,
ConnPolicy policy);
377 bool createStream(
const std::string& component,
const std::string& port,
ConnPolicy policy);
388 bool connectServices(
const std::string& one,
const std::string& other);
396 bool connectOperations(
const std::string& required,
const std::string& provided);
408 bool addPeer(
const std::string& from,
const std::string& target);
421 bool aliasPeer(
const std::string& from,
const std::string& target,
const std::string& alias);
440 bool import(
const std::string& package);
449 void path(
const std::string& path);
460 bool loadLibrary(
const std::string& name);
471 bool reloadLibrary(
const std::string& filepath);
484 bool loadComponent(
const std::string& name,
const std::string& type);
500 bool loadService(
const std::string& component,
const std::string& service);
510 bool unloadComponent(
const std::string& name);
517 void displayComponentTypes()
const;
524 std::vector<std::string> getComponentTypes()
const;
537 bool setPeriodicActivity(
const std::string& comp_name,
538 double period,
int priority,
552 bool setActivity(
const std::string& comp_name,
553 double period,
int priority,
567 bool setFileDescriptorActivity(
const std::string& comp_name,
568 double timeout,
int priority,
583 bool setActivityOnCPU(
const std::string& comp_name,
584 double period,
int priority,
585 int scheduler,
unsigned int cpu_nr);
595 bool setSequentialActivity(
const std::string& comp_name);
606 bool setSlaveActivity(
const std::string& comp_name,
617 bool setMasterSlaveActivity(
const std::string& comp_name,
618 const std::string& master_name);
635 bool setNamedActivity(
const std::string& comp_name,
636 const std::string& act_type,
637 double period,
int priority,
638 int scheduler,
const std::string& master_name =
"");
654 bool setNamedActivity(
const std::string& comp_name,
655 const std::string& act_type,
656 double period,
int priority,
657 int scheduler,
unsigned cpu_affinity,
658 const std::string& master_name =
"");
668 bool setWaitPeriodPolicy(
const std::string& comp_name,
686 bool loadComponents(
const std::string& config_file);
700 bool loadComponentsInGroup(
const std::string& config_file,
729 bool configureComponents();
738 bool configureComponentsGroup(
const int group);
745 bool startComponents();
751 bool startComponentsGroup(
const int group);
757 void clearConfiguration();
762 bool stopComponents();
768 bool stopComponentsGroup(
const int group);
773 bool cleanupComponents();
779 bool cleanupComponentsGroup(
const int group);
784 bool unloadComponents();
790 bool unloadComponentsGroup(
const int group);
796 bool kickStart(
const std::string& file_name);
814 bool kickStart2(
const std::string& configurationfile,
825 bool kickOutComponent(
const std::string& comp_name);
831 void kickOut(
const std::string& config_file);
843 bool kickOutGroup(
const int group);
849 bool runScript(
const std::string& file_name);
851 using base::TaskCore::configure;
861 bool configure(
const std::string& name);
872 bool configureFromFile(
const std::string& name,
const std::string& filename);
888 bool loadConfiguration(
const std::string& config_file);
896 bool loadConfigurationString(
const std::string& config_text);
918 return this->configureComponent( this->getPeer(comp_name) );
935 return this->startComponent( this->getPeer(comp_name) );
952 return this->stopComponent( this->getPeer(comp_name) );
969 return this->cleanupComponent( this->getPeer(comp_name) );
979 void shutdownDeployment();
987 bool waitForSignals(
int *sigs, std::size_t sig_count);
993 bool waitForSignal(
int signumber);
999 bool waitForInterrupt();
bool startComponent(const std::string &comp_name)
RTT::Constant< int > lowest_Priority
RTT::Constant< int > highest_Priority
RTT::Attribute< std::string > target
int group
Group number this component belongs to.
std::vector< RTT::TaskContext * > Owners
std::vector< std::string > plugins
RTT::Attribute< bool > validConfig
boost::shared_ptr< ServiceRequester > shared_ptr
virtual bool connectPeers(TaskContext *peer)
bool stopComponent(const std::string &comp_name)
RTT::Constant< int > sched_OTHER
RTT::Property< bool > autoUnload
std::map< std::string, ComponentLoaderSignature > FactoryMap
RTT::TaskContext * myGetPeer(std::string name)
boost::shared_ptr< Service > shared_ptr
std::map< std::string, ComponentData > CompMap
std::map< std::string, ConnectionData > ConMap
std::vector< RTT::base::PortInterface * > Ports
base::ActivityInterface * act
RTT::Constant< int > sched_RT
RTT::TaskContext * instance
virtual bool connectPorts(TaskContext *peer)
bool configureComponent(const std::string &comp_name)
bool connectPorts(TaskContext *A, TaskContext *B)
virtual bool connectServices(TaskContext *peer)
std::list< std::string > CompList
int nextGroup
Next group number.
int defaultWaitPeriodPolicy
virtual bool addPeer(TaskContext *peer, std::string alias="")
bool cleanupComponent(const std::string &comp_name)
bool connectPeers(TaskContext *A, TaskContext *B)