00001
00002
00003 #ifndef _REC_ROBOTINO_COM_COMID_H_
00004 #define _REC_ROBOTINO_COM_COMID_H_
00005
00006 namespace rec
00007 {
00008 namespace robotino
00009 {
00010 namespace com
00011 {
00012 class ComImpl;
00013
00019 class
00020 #ifdef WIN32
00021 # ifdef rec_robotino_com_EXPORTS
00022 __declspec(dllexport)
00023 # else
00024 # ifdef rec_robotino_com2_EXPORTS
00025 __declspec(dllexport)
00026 # else
00027 # ifdef rec_robotino_com3_EXPORTS
00028 __declspec(dllexport)
00029 # else
00030 # ifndef rec_robotino_com_static
00031 __declspec(dllimport)
00032 # endif
00033 # endif
00034 # endif
00035 # endif
00036 #endif
00037 ComId
00038 {
00039 friend class ComImpl;
00040 public:
00041 ComId()
00042 : _id( 1 )
00043 {
00044 }
00045
00046 bool operator==( const ComId& other ) const
00047 {
00048 return other._id == _id;
00049 }
00050
00051 bool operator!=( const ComId& other ) const
00052 {
00053 return other._id != _id;
00054 }
00055
00056 bool operator<( const ComId& other ) const
00057 {
00058 return other._id < _id;
00059 }
00060
00061 bool isNull() const;
00062
00063 operator bool() const { return !isNull(); }
00064
00065 static const ComId null;
00066
00067 private:
00068 ComId( unsigned int id )
00069 : _id( id )
00070 {
00071 }
00072
00073 static unsigned int g_id;
00074
00075 unsigned int _id;
00076 };
00077 }
00078 }
00079 }
00080
00081 #endif //_REC_ROBOTINO_COM_COMID_H_