-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathmain4.cpp
76 lines (65 loc) · 2.92 KB
/
main4.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include "CorbaNameService.hpp"
#include <rtt/TaskContext.hpp>
#include <rtt/internal/ConnectionManager.hpp>
#include "LoggingHelper.hpp"
#include <lib_config/Bundle.hpp>
#include "PluginHelper.hpp"
using namespace orocos_cpp;
int main(int argc, char **argv)
{
// Bundle &bundle(Bundle::getInstance());
PluginHelper::loadAllPluginsInDir("/home/scotch/coyote/install/lib/orocos/gnulinux/types/");
PluginHelper::loadAllPluginsInDir("/home/scotch/coyote/install/lib/orocos/types/");
CorbaNameService ns;
ns.connect();
std::vector<std::string> tasks = ns.getRegisteredTasks();
LoggingHelper lh;
for(std::string &taksName: tasks)
{
std::cout << "Got TaskContext " << taksName << std::endl;
// RTT::TaskContext *context = ns.getTaskContext(taksName);
// lh.logAllPorts(context);
// RTT::TaskContext *context = ns.getTaskContext(taksName);
// if(context)
// {
// std::cout << "Got TaskContext " << taksName << " component says its name is " << context->getName() << std::endl;
//
// RTT::DataFlowInterface *dfi = context->ports();
// std::vector<RTT::base::PortInterface *> ports = dfi->getPorts();
//
// for(RTT::base::PortInterface *port: ports)
// {
// std::cout << "Port " << port->getName() << std::endl;
// const RTT::internal::ConnectionManager *conManager = port->getManager();
// auto channels = conManager->getChannels();
// for(RTT::internal::ConnectionManager::ChannelDescriptor desc: channels)
// {
// boost::shared_ptr<RTT::internal::ConnID> connID(desc.head);
// RTT::ConnPolicy policy = desc.get<2>();
// std::cout << " Connection from " << connID->getInputTaskName() << "." << connID->getInputPortName() << " to "
// << connID->getOutputTaskName() << "." << connID->getOutputPortName() << " of type ";
//
// switch(policy.type)
// {
// case RTT::ConnPolicy::BUFFER:
// std::cout << "Buffer";
// break;
// case RTT::ConnPolicy::DATA:
// std::cout << "Data";
// break;
// case RTT::ConnPolicy::CIRCULAR_BUFFER:
// std::cout << "Circular Buffer";
// break;
// case RTT::ConnPolicy::UNBUFFERED:
// std::cout << "Unbuffered";
// break;
// }
//
// std::cout << std::endl;
// }
// }
//
// }
}
return 0;
}