ConfigSampleComp.cpp
Go to the documentation of this file.
1 // -*- C++ -*-
10 #include <rtm/Manager.h>
11 #include <iostream>
12 #include <string>
13 #include "ConfigSample.h"
14 
15 
17 {
18  ConfigSampleInit(manager);
19  RTC::RtcBase* comp;
20 
21  // Create a component
22  comp = manager->createComponent("ConfigSample");
23 
24 
25  // Example
26  // The following procedure is examples how handle RT-Components.
27  // These should not be in this function.
28 
29  // Get the component's object reference
30  RTC::RTObject_var rtobj;
31  rtobj = RTC::RTObject::_narrow(comp->_default_POA()->servant_to_reference(comp));
32 
33  RTC::ExecutionContextList_var ecs;
34  ecs = rtobj->get_owned_contexts();
35  ecs[(CORBA::ULong)0]->activate_component(rtobj);
36 
37  return;
38 }
39 
40 int main (int argc, char** argv)
41 {
43  manager = RTC::Manager::init(argc, argv);
44 
45  // Set module initialization proceduer
46  // This procedure will be invoked in activateManager() function.
48 
49  // Activate manager and register to naming service
50  manager->activateManager();
51 
52  // run the manager in blocking mode
53  // runManager(false) is the default.
54  manager->runManager();
55 
56  // If you want to run the manager in non-blocking mode, do like this
57  // manager->runManager(true);
58 
59  return 0;
60 }
RTObject_impl * createComponent(const char *comp_args)
Create RT-Components.
Definition: Manager.cpp:520
void MyModuleInit(RTC::Manager *manager)
void runManager(bool no_block=false)
Run the Manager.
Definition: Manager.cpp:318
RT-Component class.
Definition: RTObject.h:89
Manager class.
Definition: Manager.h:80
Configuration example component.
RTComponent manager class.
static Manager * init(int argc, char **argv)
Initialize manager.
Definition: Manager.cpp:110
void ConfigSampleInit(RTC::Manager *manager)
bool activateManager()
Activate the Manager.
Definition: Manager.cpp:244
virtual ExecutionContextList * get_owned_contexts()
[CORBA interface] Get ExecutionContextList.
Definition: RTObject.cpp:499
void setModuleInitProc(ModuleInitProc proc)
Set initial procedure.
Definition: Manager.cpp:232
int main(int argc, char **argv)


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Thu Jun 6 2019 19:25:57