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