Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00019 #include <rtm/Manager.h>
00020 #include <iostream>
00021 #include <string>
00022 #include "SampleSV.h"
00023
00024
00025 void MyModuleInit(RTC::Manager* manager)
00026 {
00027 SampleSVInit(manager);
00028 RTC::RtcBase* comp;
00029
00030
00031 comp = manager->createComponent("SampleSV");
00032
00033
00034
00035
00036
00037
00038
00039 RTC::RTObject_var rtobj;
00040 rtobj = RTC::RTObject::_narrow(manager->getPOA()->servant_to_reference(comp));
00041
00042
00043 PortServiceList* portlist;
00044 portlist = rtobj->get_ports();
00045
00046
00047 std::cout << "Number of Ports: ";
00048 std::cout << portlist->length() << std::endl << std::endl;
00049 for (CORBA::ULong i(0), n(portlist->length()); i < n; ++i)
00050 {
00051 PortService_ptr port;
00052 port = (*portlist)[i];
00053 std::cout << "Port" << i << " (name): ";
00054 std::cout << port->get_port_profile()->name << std::endl;
00055
00056 RTC::PortInterfaceProfileList iflist;
00057 iflist = port->get_port_profile()->interfaces;
00058 std::cout << "---interfaces---" << std::endl;
00059 for (CORBA::ULong i(0), n(iflist.length()); i < n; ++i)
00060 {
00061 std::cout << "I/F name: ";
00062 std::cout << iflist[i].instance_name << std::endl;
00063 std::cout << "I/F type: ";
00064 std::cout << iflist[i].type_name << std::endl;
00065 const char* pol;
00066 pol = iflist[i].polarity == 0 ? "PROVIDED" : "REQUIRED";
00067 std::cout << "Polarity: " << pol << std::endl;
00068 }
00069 std::cout << "---properties---" << std::endl;
00070 NVUtil::dump(port->get_port_profile()->properties);
00071 std::cout << "----------------" << std::endl << std::endl;
00072 }
00073
00074 return;
00075 }
00076
00077 int main (int argc, char** argv)
00078 {
00079 RTC::Manager* manager;
00080 manager = RTC::Manager::init(argc, argv);
00081
00082
00083 manager->init(argc, argv);
00084
00085
00086
00087 manager->setModuleInitProc(MyModuleInit);
00088
00089
00090 manager->activateManager();
00091
00092
00093
00094 manager->runManager();
00095
00096
00097
00098
00099 return 0;
00100 }