メインページ | ネームスペース一覧 | クラス階層 | 構成 | Directories | ファイル一覧 | ネームスペースメンバ | 構成メンバ | ファイルメンバ

RtcOutPortBase.h

説明を見る。
00001 // -*- C++ -*-
00019 /*
00020  * $Log: RtcOutPortBase.h,v $
00021  * Revision 1.3  2005/05/27 07:34:21  n-ando
00022  * - InPort/OutPort interface was changed.
00023  *   subscribe/unsubscribe were completely changed.
00024  *
00025  * Revision 1.2  2005/05/16 06:37:11  n-ando
00026  * - OutPortBase class was DLL exported for Windows port.
00027  * - m_Profile.name should be initialized with empty string.
00028  *
00029  * Revision 1.1.1.1  2005/05/12 09:06:18  n-ando
00030  * Public release.
00031  *
00032  *
00033  */
00034 
00035 #ifndef RtcOutPortBase_h
00036 #define RtcOutPortBase_h
00037 
00038 #include <list>
00039 #include <ace/Task.h>
00040 
00041 #include "rtm/RTC.h"
00042 #include "rtm/idl/RTCDataTypeSkel.h"
00043 #include "rtm/idl/RTCOutPortSkel.h"
00044 #include "rtm/idl/RTCOutPortStub.h"
00045 #include "rtm/RtcInPortBase.h"
00046 #include "rtm/RtcRingBuffer.h"
00047 #include "rtm/RtcSubscriber.h"
00048 
00049 
00050 namespace RTM {
00051   class SubscriberBase;
00052 
00074   class EXPORTS OutPortBase :
00075         public POA_RTM::OutPort,
00076         public PortableServer::RefCountServantBase
00077   {
00078   public:
00093         OutPortBase()
00094         {
00095           m_Profile.name = _CORBA_String_helper::empty_string;
00096         };
00097 
00112         virtual ~OutPortBase(){};
00113 
00114         //============================================================
00115         // CORBA interfaces.
00116         //============================================================
00128         virtual CORBA::Any* get() throw (CORBA::SystemException) = 0;
00129 
00131         //      virtual CORBA::TypeCode_ptr port_type();
00132 
00133         //------------------------------------------------------------
00134         // RTCPortBase interfaces
00135         //------------------------------------------------------------
00147         virtual RtmRes subscribe(SubscriptionProfile &subs)
00148           throw (CORBA::SystemException, RTM::PortBase::InvalidSubscription);
00149 
00161         virtual RtmRes notify_subscribe(SubscriptionProfile &subs)
00162           throw (CORBA::SystemException, RTM::PortBase::InvalidSubscription);
00163 
00175         virtual RtmRes unsubscribe(const char* id)
00176           throw (CORBA::SystemException, RTM::PortBase::NoSubscription);
00177 
00189         virtual RtmRes notify_unsubscribe(const char* id)
00190           throw (CORBA::SystemException, RTM::PortBase::NoSubscription);
00191 
00203         //      virtual InPortList* inports() throw (CORBA::SystemException);
00204 
00216         virtual PortProfile* profile() throw (CORBA::SystemException);
00217 
00229         virtual SubscriptionList* subscriptions();
00230 
00231 
00232 
00233         // End of CORBA interfaces
00234         //============================================================
00235         bool createSubscriber(SubscriptionProfile& subscription);
00247         //      virtual RtmRes push(const InPort_ptr& inport, std::string& subsid) = 0;
00248         virtual RtmRes push(InPort_ptr inport, std::string subsid) = 0;
00249 
00261         virtual void updateall();
00262 
00274         virtual void disconnect_all();
00275 
00287         virtual const char* name() {return m_Profile.name;};
00288 
00305         virtual void write_pm() = 0;
00306 
00307         virtual OutPort_ptr getObjRef();
00308         virtual void setObjRef(OutPort_ptr objref);
00309 
00310 
00311   protected:
00312         virtual RtmRes unsubscribeNoLocked(const char* id)
00313           throw (CORBA::SystemException, RTM::PortBase::NoSubscription);
00314 
00323         typedef std::list<SubscriberBase*>::iterator Subs_it;   
00324         struct Subscribers
00325         {
00326           ACE_Thread_Mutex m_Mutex;
00327           std::list<SubscriberBase*> m_List;
00328           
00329           class eq_id
00330           {
00331           public:
00332                 const std::string m_id;
00333                 eq_id(const char* id) : m_id(id){};
00334                 bool operator()(SubscriberBase* subs);
00335           };
00336           Subs_it findById(const char* id);
00337           Subs_it eraseById(const char* id);
00338         };
00339         Subscribers m_Subscribers;
00340 
00341 
00349         PortProfile m_Profile;
00350 
00358         OutPort_var m_thisObjRef;
00359 
00360 
00361 
00362   };
00363 
00364 
00365   
00366 }; // End of namespace RTM
00367 
00368 #endif // RtcOutPortBase_h

OpenRTMに対してSun Nov 5 06:15:05 2006に生成されました。  doxygen 1.4.1