00001 //================================================================================================= 00002 // ORBvar管理クラス(ベースクラス) 及び RT コンポーネントコントロールクラス 00003 // 00004 // date : 20080720 first 00005 // date : 20080721 update 00006 // 00007 // Author : Takashi KOJIMA, Chuo University 00008 // 00009 //================================================================================================= 00010 #ifndef INTERFACE_CONTROL_RT_COMPONENT_MODEL_CLASS 00011 #define INTERFACE_CONTROL_RT_COMPONENT_MODEL_CLASS 00012 00013 #include <iostream> 00014 #include <string> 00015 #include <rtm/CorbaNaming.h> 00016 #include <rtm/RTObject.h> 00017 #include <assert.h> 00018 00020 00024 class ORBvarManager 00025 { 00026 private: 00027 bool m_delete; 00028 static long s_exist_cnt; 00029 00030 public: 00031 static CORBA::ORB_var s_orb; 00032 00033 ORBvarManager(bool idelete = false); 00034 00036 virtual ~ORBvarManager(); 00037 00039 void static ORBInit(); 00040 00042 void static ORBdestroy(); 00043 00044 }; 00045 00046 00048 class RTCompControl : public ORBvarManager 00049 { 00050 public: 00052 RTCompControl(std::string OmniNameServerName,long port = -1); 00053 00054 00056 RTCompControl(const RTCompControl& src); 00057 00059 virtual ~RTCompControl(); 00060 00062 void SetRTComponent(std::string ComponentName); 00063 00065 void Activate(); 00066 00068 void Deactivate(); 00069 00071 void Reset(); 00072 00074 void SetNameServer(std::string OmniNameServerName, long OmniPort = -1); 00075 00077 RTCompControl& operator=(const RTCompControl& right); 00078 00079 protected: 00080 RTC::CorbaNaming m_nameserver; 00081 RTC::CorbaConsumer<RTC::RTObject> m_con; 00082 RTC::ExecutionContextServiceList_var m_eclist; 00083 00085 00090 std::string NameAndPort2str(std::string name, long port); 00091 00092 }; 00093 00094 #endif