IceServantBase.h
Go to the documentation of this file.
00001 // -*- C++ -*-
00019 #ifndef DOIL_ICE_ICESERVANTBASE_H
00020 #define DOIL_ICE_ICESERVANTBASE_H
00021 
00022 #include <rtm/config_rtc.h>
00023 #include <doil/ServantBase.h>
00024 #include <doil/ImplBase.h>
00025 #include <doil/ice/Ice.h>
00026 
00027 namespace doil
00028 {
00029 namespace Ice
00030 {
00031   class IceServantBase
00032     : public virtual doil::ServantBase,
00033       public virtual ::Ice::Object
00034   {
00035   public:
00036     IceServantBase(ImplBase* impl)
00037       : m_refcount(1), m_id(impl->id()), m_name(impl->name())
00038     {
00039     }
00040     virtual ~IceServantBase(){}
00041 
00042     virtual const char* id() const
00043     {
00044       return m_id.c_str();
00045     }
00046 
00047     virtual const char* name() const
00048     {
00049       return m_name.c_str();
00050     }
00051 
00052     virtual void incRef()
00053     {
00054       ++m_refcount;
00055     }
00056 
00057     virtual void decRef()
00058     {
00059       --m_refcount;
00060       if (m_refcount == 0)
00061         delete this;
00062     }
00063 
00064   protected:
00065     int m_refcount;
00066     std::string m_id;
00067     std::string m_name;
00068 
00069   };
00070 }; // namespoace doil
00071 }; // namespace Ice
00072 #endif // DOIL_ICE_ICESERVANTBASE_H
00073 


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Sun Mar 26 2017 03:37:15