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 #else
00037 # ifndef SWIG
00038 __attribute__ ((visibility ("default")))
00039 # endif
00040 #endif
00041 ComId
00042 {
00043 friend class ComImpl;
00044 public:
00045 ComId()
00046 : _id( 1 )
00047 {
00048 }
00049
00050 bool operator==( const ComId& other ) const
00051 {
00052 return other._id == _id;
00053 }
00054
00055 bool operator!=( const ComId& other ) const
00056 {
00057 return other._id != _id;
00058 }
00059
00060 bool operator<( const ComId& other ) const
00061 {
00062 return other._id < _id;
00063 }
00064
00065 bool isNull() const;
00066
00067 operator bool() const { return !isNull(); }
00068
00069 static const ComId null;
00070
00071 private:
00072 ComId( unsigned int id )
00073 : _id( id )
00074 {
00075 }
00076
00077 static unsigned int g_id;
00078
00079 unsigned int _id;
00080 };
00081 }
00082 }
00083 }
00084
00085 #endif //_REC_ROBOTINO_COM_COMID_H_