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


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