Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

RtcFactory.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00019 /*
00020  * $Log: RtcFactory.h,v $
00021  * Revision 1.1.1.1  2005/05/12 09:06:18  n-ando
00022  * Public release.
00023  *
00024  *
00025  */
00026 
00027 #ifndef RtcFactory_h
00028 #define RtcFactory_h
00029 
00030 #include "rtm/RtcModuleProfile.h"
00031 
00032 
00033 namespace RTM 
00034 {
00035   class RtcBase;
00036   class RtcManager;
00056   class RtcFactoryBase
00057   {
00058   public:
00078     RtcFactoryBase(RtcModuleProfile profile)
00079       : m_Profile(profile), m_Number(-1) {};
00080         
00102     virtual RtcBase* create(RtcManager* mgr) = 0;
00103         
00125     virtual void destroy(RtcBase* comp) = 0;
00126         
00142     virtual RtcModuleProfile& profile() {return m_Profile;};
00143         
00159     virtual int& number() {return m_Number;};
00160         
00161   protected:
00169     RtcModuleProfile m_Profile;
00177         int m_Number;
00178   };
00179   
00180   
00181   
00201   class RtcFactoryCXX
00202     : public RtcFactoryBase
00203   {
00204   public:
00233     RtcFactoryCXX(RtcModuleProfile profile,
00234                                   RtcNewFunc new_func,
00235                                   RtcDeleteFunc delete_func);
00236         
00256     virtual RtcBase* create(RtcManager* mgr);
00257         
00277     virtual void destroy(RtcBase* comp);
00278         
00279   protected:
00287     RtcNewFunc m_New;
00288         
00296     RtcDeleteFunc m_Delete;
00297   };
00298 };
00299 
00300 
00301 #endif // RtcFactory_h

Generated on Mon May 23 03:13:56 2005 for OpenRTM by doxygen 1.3.6