19 #include <rtm/Manager.h>
31 comp = manager->createComponent(
"SamplePD");
39 RTC::RTObject_var rtobj;
40 rtobj = RTC::RTObject::_narrow(manager->getPOA()->servant_to_reference(comp));
43 PortServiceList* portlist;
44 portlist = rtobj->get_ports();
47 std::cout <<
"Number of Ports: ";
48 std::cout << portlist->length() << std::endl << std::endl;
49 for (CORBA::ULong
i(0),
n(portlist->length());
i <
n; ++
i)
52 port = (*portlist)[
i];
53 std::cout <<
"Port" <<
i <<
" (name): ";
54 std::cout << port->get_port_profile()->name << std::endl;
56 RTC::PortInterfaceProfileList iflist;
57 iflist = port->get_port_profile()->interfaces;
58 std::cout <<
"---interfaces---" << std::endl;
59 for (CORBA::ULong
i(0),
n(iflist.length());
i <
n; ++
i)
61 std::cout <<
"I/F name: ";
62 std::cout << iflist[
i].instance_name << std::endl;
63 std::cout <<
"I/F type: ";
64 std::cout << iflist[
i].type_name << std::endl;
66 pol = iflist[
i].polarity == 0 ?
"PROVIDED" :
"REQUIRED";
67 std::cout <<
"Polarity: " << pol << std::endl;
69 std::cout <<
"---properties---" << std::endl;
70 NVUtil::dump(port->get_port_profile()->properties);
71 std::cout <<
"----------------" << std::endl << std::endl;
77 int main (
int argc,
char** argv)
79 RTC::Manager* manager;
80 manager = RTC::Manager::init(argc, argv);
83 manager->init(argc, argv);
90 manager->activateManager();
94 manager->runManager();