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

PortAdmin.h

説明を見る。
00001 // -*- C++ -*-
00019 /*
00020  * $Log: PortAdmin.h,v $
00021  * Revision 1.6.4.1  2007/09/20 11:25:11  n-ando
00022  * A function getPortProfileList() was added to get PortProfileList locally.
00023  *
00024  * Revision 1.6  2007/01/21 10:28:09  n-ando
00025  * Some trivial fixes.
00026  *
00027  * Revision 1.5  2007/01/09 15:13:11  n-ando
00028  * Now Port does not have getName().
00029  * The name of Port is obtained from getProfile().
00030  *
00031  * Revision 1.4  2006/12/02 18:49:43  n-ando
00032  * A trivial fix.
00033  *
00034  * Revision 1.3  2006/11/06 01:19:04  n-ando
00035  * CORBA sequence manipulation has been rewritten by using CORBA_SeqUtil.
00036  *
00037  * Revision 1.2  2006/10/17 19:16:40  n-ando
00038  * registerPort() was modified to store Port's object reference in PortProfile.
00039  *
00040  * Revision 1.1  2006/10/17 10:22:01  n-ando
00041  * The first commitment.
00042  *
00043  */
00044 
00045 #ifndef PortAdmin_h
00046 #define PortAdmin_h
00047 
00048 #include <rtm/idl/RTCSkel.h>
00049 #include <rtm/PortBase.h>
00050 #include <rtm/ObjectManager.h>
00051 // 68608 10 17 23:51 PortAdmin.o
00052 // 54272 10 29 00:53 PortAdmin.o
00053 // 54132 10 29 00:54 PortAdmin.o
00054 namespace RTC
00055 {
00056 
00057 
00058   class PortAdmin
00059   {
00060   public:
00061     PortAdmin(CORBA::ORB_ptr, PortableServer::POA_ptr poa);
00062     virtual ~PortAdmin(){};
00063 
00084     PortList* getPortList() const;
00085 
00086     PortProfileList getPortProfileList() const;
00111     Port_ptr getPortRef(const char* port_name) const;
00112 
00113 
00138     PortBase* getPort(const char* port_name) const;
00139 
00140 
00165     void registerPort(PortBase& port);
00166 
00167 
00191     void deletePort(PortBase& port);
00192 
00216     void deletePortByName(const char* port_name);
00217 
00218 
00236     void finalizePorts();
00237 
00238   private:
00239     // ORB へのポインタ
00240     CORBA::ORB_var m_pORB;
00241 
00242     // POA へのポインタ
00243     PortableServer::POA_var m_pPOA;
00244 
00245     // Portのオブジェクトリファレンスのリスト. PortList
00246     PortList m_portRefs;
00247 
00248 
00249     template <class T>
00250     class comp_op
00251     {
00252     public:
00253       comp_op(const char* _name)
00254         :
00255         m_name(_name)
00256       {
00257       }
00258       comp_op(T* obj) 
00259         : m_name((const char*)(obj->getProfile().name))
00260       {
00261       }
00262       bool operator()(T* obj)
00263       {
00264         std::string name((const char*)obj->getProfile().name);
00265         return m_name == name;
00266       }
00267     private:
00268       std::string m_name;
00269     };
00270 
00271     class port_prof_collect
00272     {
00273     public:
00274       port_prof_collect(PortProfileList& p) : m_p(p) {}
00275       void operator()(const PortBase* port)
00276       {
00277         CORBA_SeqUtil::push_back(m_p, port->getPortProfile());
00278       }
00279     private:
00280       PortProfileList& m_p;
00281     };
00282     
00283     struct find_port_name;
00284     struct del_port;
00285 
00286     // サーバントを直接格納するオブジェクトマネージャ
00287     ObjectManager<const char*, PortBase, comp_op<PortBase> > m_portServants;
00288 
00289 
00290   };
00291 };     // namespace RTC
00292 #endif // PortAdmin_h

OpenRTMに対してFri Oct 5 05:14:57 2007に生成されました。  doxygen 1.4.1