SeqInComp.cpp
Go to the documentation of this file.
1 // -*- C++ -*-
10 #include <rtm/Manager.h>
11 #include <iostream>
12 #include <string>
13 #include "SeqIn.h"
14 
15 
16 // Connector Listener Dump Flag : default OFF
17 extern bool g_Listener_dump_enabled;
18 
20 {
21  SeqInInit(manager);
22  RTC::RtcBase* comp;
23 
24  // Create a component
25  comp = manager->createComponent("SeqIn");
26 
27 
28  // Example
29  // The following procedure is examples how handle RT-Components.
30  // These should not be in this function.
31 
32  // Get the component's object reference
33 // RTC::RTObject_var rtobj;
34 // rtobj = RTC::RTObject::_narrow(manager->getPOA()->servant_to_reference(comp));
35 
36  // Get the port list of the component
37 // PortList* portlist;
38 // portlist = rtobj->get_ports();
39 
40  // getting port profiles
41 // std::cout << "Number of Ports: ";
42 // std::cout << portlist->length() << std::endl << std::endl;
43 // for (CORBA::ULong i(0), n(portlist->length()); i < n; ++i)
44 // {
45 // Port_ptr port;
46 // port = (*portlist)[i];
47 // std::cout << "Port" << i << " (name): ";
48 // std::cout << port->get_port_profile()->name << std::endl;
49 //
50 // RTC::PortInterfaceProfileList iflist;
51 // iflist = port->get_port_profile()->interfaces;
52 // std::cout << "---interfaces---" << std::endl;
53 // for (CORBA::ULong i(0), n(iflist.length()); i < n; ++i)
54 // {
55 // std::cout << "I/F name: ";
56 // std::cout << iflist[i].instance_name << std::endl;
57 // std::cout << "I/F type: ";
58 // std::cout << iflist[i].type_name << std::endl;
59 // const char* pol;
60 // pol = iflist[i].polarity == 0 ? "PROVIDED" : "REQUIRED";
61 // std::cout << "Polarity: " << pol << std::endl;
62 // }
63 // std::cout << "---properties---" << std::endl;
64 // NVUtil::dump(port->get_port_profile()->properties);
65 // std::cout << "----------------" << std::endl << std::endl;
66 // }
67 
68  return;
69 }
70 
71 int main (int argc, char** argv)
72 {
73  // check parameter
74  if(argc > 1)
75  {
76  for (int i = 1; i < argc; ++i)
77  {
78  std::string arg(argv[i]);
79  coil::normalize(arg);
80  if (arg == "-listener")
81  {
82  // Connector Listener Dump Flag ON
84  std::cout << "Connector Listener Callback Dump start (Port: TimedLong)" << std::endl;
85  }
86  }
87  }
88 
90  manager = RTC::Manager::init(argc, argv);
91 
92  // Set module initialization proceduer
93  // This procedure will be invoked in activateManager() function.
95 
96  // Activate manager and register to naming service
97  manager->activateManager();
98 
99  // run the manager in blocking mode
100  // runManager(false) is the default.
101  manager->runManager();
102 
103  // If you want to run the manager in non-blocking mode, do like this
104  // manager->runManager(true);
105 
106  return 0;
107 }
std::string normalize(std::string &str)
Erase the head/tail blank and replace upper case to lower case.
Definition: stringutil.cpp:303
RTObject_impl * createComponent(const char *comp_args)
Create RT-Components.
Definition: Manager.cpp:520
void MyModuleInit(RTC::Manager *manager)
Definition: SeqInComp.cpp:19
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
bool g_Listener_dump_enabled
Definition: SeqIn.cpp:14
RTComponent manager class.
void SeqInInit(RTC::Manager *manager)
Definition: SeqIn.cpp:436
static Manager * init(int argc, char **argv)
Initialize manager.
Definition: Manager.cpp:110
Sequence InPort component.
bool activateManager()
Activate the Manager.
Definition: Manager.cpp:244
void setModuleInitProc(ModuleInitProc proc)
Set initial procedure.
Definition: Manager.cpp:232
int main(int argc, char **argv)
Definition: SeqInComp.cpp:71


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Mon Jun 10 2019 14:07:56