USBCameraMonitorComp.cpp
Go to the documentation of this file.
1 // -*- C++ -*-
10 #include <rtm/Manager.h>
11 #include <iostream>
12 #include <string>
13 #include "USBCameraMonitor.h"
14 
15 
17 {
18  USBCameraMonitorInit(manager);
19  RTC::RtcBase* comp;
20 
21  // Create a component
22  comp = manager->createComponent("USBCameraMonitor");
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(manager->getPOA()->servant_to_reference(comp));
32 
33  // Get the port list of the component
34 // PortList* portlist;
35 // portlist = rtobj->get_ports();
36 
37  // getting port profiles
38 // std::cout << "Number of Ports: ";
39 // std::cout << portlist->length() << std::endl << std::endl;
40 // for (CORBA::ULong i(0), n(portlist->length()); i < n; ++i)
41 // {
42 // Port_ptr port;
43 // port = (*portlist)[i];
44 // std::cout << "Port" << i << " (name): ";
45 // std::cout << port->get_port_profile()->name << std::endl;
46 //
47 // RTC::PortInterfaceProfileList iflist;
48 // iflist = port->get_port_profile()->interfaces;
49 // std::cout << "---interfaces---" << std::endl;
50 // for (CORBA::ULong i(0), n(iflist.length()); i < n; ++i)
51 // {
52 // std::cout << "I/F name: ";
53 // std::cout << iflist[i].instance_name << std::endl;
54 // std::cout << "I/F type: ";
55 // std::cout << iflist[i].type_name << std::endl;
56 // const char* pol;
57 // pol = iflist[i].polarity == 0 ? "PROVIDED" : "REQUIRED";
58 // std::cout << "Polarity: " << pol << std::endl;
59 // }
60 // std::cout << "---properties---" << std::endl;
61 // NVUtil::dump(port->get_port_profile()->properties);
62 // std::cout << "----------------" << std::endl << std::endl;
63 // }
64 
65  return;
66 }
67 
68 int main (int argc, char** argv)
69 {
71 
72  manager = RTC::Manager::init(argc, argv);
73 
74  // Initialize manager
75  manager->init(argc, argv);
76 
77  // Set module initialization proceduer
78  // This procedure will be invoked in activateManager() function.
80 
81  // Activate manager and register to naming service
82  manager->activateManager();
83 
84  // run the manager in blocking mode
85  // runManager(false) is the default.
86  manager->runManager();
87 
88  // If you want to run the manager in non-blocking mode, do like this
89  // manager->runManager(true);
90 
91  return 0;
92 }
RTObject_impl * createComponent(const char *comp_args)
Create RT-Components.
Definition: Manager.cpp:520
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
RTComponent manager class.
static Manager * init(int argc, char **argv)
Initialize manager.
Definition: Manager.cpp:110
bool activateManager()
Activate the Manager.
Definition: Manager.cpp:244
int main(int argc, char **argv)
void MyModuleInit(RTC::Manager *manager)
&#39;hellow
void setModuleInitProc(ModuleInitProc proc)
Set initial procedure.
Definition: Manager.cpp:232
void USBCameraMonitorInit(RTC::Manager *manager)


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Thu Jun 6 2019 19:26:01