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