00001 // -*- C++ -*- 00010 #include <rtm/Manager.h> 00011 #include <iostream> 00012 #include <string> 00013 #include "ConfigSample.h" 00014 00015 00016 void MyModuleInit(RTC::Manager* manager) 00017 { 00018 ConfigSampleInit(manager); 00019 RTC::RtcBase* comp; 00020 00021 // Create a component 00022 comp = manager->createComponent("ConfigSample"); 00023 00024 00025 // Example 00026 // The following procedure is examples how handle RT-Components. 00027 // These should not be in this function. 00028 00029 // Get the component's object reference 00030 RTC::RTObject_var rtobj; 00031 rtobj = RTC::RTObject::_narrow(comp->_default_POA()->servant_to_reference(comp)); 00032 00033 RTC::ExecutionContextList_var ecs; 00034 ecs = rtobj->get_owned_contexts(); 00035 ecs[(CORBA::ULong)0]->activate_component(rtobj); 00036 00037 return; 00038 } 00039 00040 int main (int argc, char** argv) 00041 { 00042 RTC::Manager* manager; 00043 manager = RTC::Manager::init(argc, argv); 00044 00045 // Set module initialization proceduer 00046 // This procedure will be invoked in activateManager() function. 00047 manager->setModuleInitProc(MyModuleInit); 00048 00049 // Activate manager and register to naming service 00050 manager->activateManager(); 00051 00052 // run the manager in blocking mode 00053 // runManager(false) is the default. 00054 manager->runManager(); 00055 00056 // If you want to run the manager in non-blocking mode, do like this 00057 // manager->runManager(true); 00058 00059 return 0; 00060 }