00001
00002 #include <rtm/Manager.h>
00003 #include <rtm.RtcBase.h>
00004
00005
00006
00007
00008 class MyComponent
00009 : public RtcBase
00010 {
00011 public:
00012 MyComponent(RTC::Manager* manager)
00013 : RtcBase(manager)
00014 {
00015 }
00016
00017
00018 ReturnCode_t onInitialize()
00019 {
00020
00021
00022 m_GenericPort.registerProvider("MyService", "MyServiceType",
00023 m_MyService);
00024 m_GenericPort.registerConsumer("YourService", "YourServiceType",
00025 m_MyService);
00026 registerPort("MyService0", m_GenericPort);
00027 }
00028
00029
00030 virtual ~MyComponent(){};
00031
00032
00033 private:
00034 RTC::GenericPort m_GenericPort;
00035 MyService m_MyService;
00036 CorbaConsumer<YourService> m_YourService;
00037 };
00038
00039
00040 extern "C"
00041 {
00042
00043 void MyComponentInit(RTC::Manager* manager)
00044 {
00045 ModuleProfile profile(mycomponent_spec);
00046 manager->registerModule(profile, NewRtc<MyComponent>);
00047 }