00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef __ENTITYTYPE_HPP
00032 #define __ENTITYTYPE_HPP
00033
00034 #include "libecs.hpp"
00035
00036
00037 namespace libecs
00038 {
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 class EntityType
00053 {
00054
00055 public:
00056
00057 enum Type
00058 {
00059 NONE = 0,
00060 ENTITY = 1,
00061 VARIABLE = 2,
00062 PROCESS = 3,
00063 SYSTEM = 4
00064 };
00065
00066 ECELL_API EntityType( StringCref typestring );
00067
00068 EntityType( const int number );
00069
00070 EntityType( const Type type )
00071 :
00072 theType( type )
00073 {
00074 ;
00075 }
00076
00077 EntityType( EntityTypeCref primitivetype )
00078 :
00079 theType( primitivetype.getType() )
00080 {
00081 ;
00082 }
00083
00084 EntityType()
00085 :
00086 theType( NONE )
00087 {
00088 ;
00089 }
00090
00091
00092 StringCref getString() const;
00093
00094 operator StringCref() const
00095 {
00096 return getString();
00097 }
00098
00099 const Type& getType() const
00100 {
00101 return theType;
00102 }
00103
00104 operator const Type&() const
00105 {
00106 return getType();
00107 }
00108
00109
00110
00111
00112
00113
00114 bool operator<( EntityTypeCref rhs ) const
00115 {
00116 return theType < rhs.getType();
00117 }
00118
00119 bool operator<( const Type rhs ) const
00120 {
00121 return theType < rhs;
00122 }
00123
00124 bool operator==( EntityTypeCref rhs ) const
00125 {
00126 return theType == rhs.getType();
00127 }
00128
00129 bool operator==( const Type rhs ) const
00130 {
00131 return theType == rhs;
00132 }
00133
00134
00135 static StringCref EntityTypeStringOfNone();
00136
00137 static StringCref EntityTypeStringOfEntity();
00138
00139 static StringCref EntityTypeStringOfProcess();
00140
00141 static StringCref EntityTypeStringOfVariable();
00142
00143 static StringCref EntityTypeStringOfSystem();
00144
00145 private:
00146
00147 Type theType;
00148
00149 };
00150
00151
00152
00153 }
00154
00155
00156 #endif