00001
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef RtcOutPortBase_h
00028 #define RtcOutPortBase_h
00029
00030 #include <list>
00031 #include <ace/Task.h>
00032
00033 #include "rtm/RTC.h"
00034 #include "rtm/idl/RTCDataTypeSkel.h"
00035 #include "rtm/idl/RTCOutPortSkel.h"
00036 #include "rtm/idl/RTCOutPortStub.h"
00037 #include "rtm/RtcInPortBase.h"
00038 #include "rtm/RtcRingBuffer.h"
00039
00040
00041 namespace RTM {
00042 class SubscriberBase;
00043 using namespace std;
00044
00066 class OutPortBase :
00067 public POA_RTM::OutPort,
00068 public PortableServer::RefCountServantBase
00069 {
00070 public:
00085 OutPortBase(){};
00086
00101 virtual ~OutPortBase(){};
00102
00103
00104
00105
00117 virtual CORBA::Any* get() throw (CORBA::SystemException) = 0;
00118
00120
00121
00133 virtual RtmRes subscribe(InPort_ptr in_port, SubscriptionID_out id,
00134 const SubscriberProfile &profile)
00135 throw (CORBA::SystemException);
00136
00148 virtual RtmRes unsubscribe(const char* id) throw (CORBA::SystemException);
00149
00161 virtual InPortList* inports() throw (CORBA::SystemException);
00162
00174 virtual PortProfile* profile() throw (CORBA::SystemException);
00175
00176
00177
00178
00190
00191 virtual RtmRes push(const InPort_ptr& inport, std::string& subsid) = 0;
00192
00204 virtual void updateall();
00205
00217 virtual void disconnect_all();
00218
00230 virtual const char* name() {return m_Profile.name;};
00231
00248 virtual void write_pm() = 0;
00249
00250
00251 protected:
00252 virtual RtmRes unsubscribeNoLocked(const char* id);
00253
00261
00262 struct Subscribers
00263 {
00264 ACE_Thread_Mutex m_Mutex;
00265 list<SubscriberBase*> m_List;
00266 };
00267 Subscribers m_Subscribers;
00268
00269
00277 PortProfile m_Profile;
00278
00279 };
00280
00281
00282
00283 };
00284
00285 #endif // RtcOutPortBase_h