00001 //############################################################################################################################################### 00002 // 00003 // Meta and Builder Object Network V2.0 for GME 00004 // Common.h 00005 // 00006 //############################################################################################################################################### 00007 00008 /* 00009 Copyright (c) Vanderbilt University, 2000-2004 00010 ALL RIGHTS RESERVED 00011 00012 Vanderbilt University disclaims all warranties with regard to this 00013 software, including all implied warranties of merchantability 00014 and fitness. In no event shall Vanderbilt University be liable for 00015 any special, indirect or consequential damages or any damages 00016 whatsoever resulting from loss of use, data or profits, whether 00017 in an action of contract, negligence or other tortious action, 00018 arising out of or in connection with the use or performance of 00019 this software. 00020 */ 00021 00022 #ifndef Common_h 00023 #define Common_h 00024 00025 #include <set> 00026 #include <string> 00027 00028 namespace MON 00029 { 00030 00031 //############################################################################################################################################### 00032 // 00033 // E N U M E R A T I O N : MON::ObjectType 00034 // 00035 //############################################################################################################################################### 00036 00037 enum ObjectType 00038 { 00039 OT_Null = 0, 00040 OT_Model = 1, 00041 OT_Atom = 2, 00042 OT_Reference = 3, 00043 OT_Connection = 4, 00044 OT_Set = 5, 00045 OT_Folder = 6, 00046 OT_Aspect, 00047 OT_Role, 00048 OT_Attribute, 00049 OT_Part 00050 }; 00051 00052 //############################################################################################################################################### 00053 // 00054 // E N U M E R A T I O N : MON::AttributeType 00055 // 00056 //############################################################################################################################################### 00057 00058 enum AttributeType 00059 { 00060 AT_String = 1, 00061 AT_Integer = 2, 00062 AT_Real = 3, 00063 AT_Boolean = 4, 00064 AT_Enumeration = 6 00065 }; 00066 00067 //############################################################################################################################################### 00068 // 00069 // E N U M E R A T I O N : MON::ObjectEventType 00070 // 00071 //############################################################################################################################################### 00072 00073 enum ObjectEventType 00074 { 00075 OET_None = 0x00000000, 00076 OET_ObjectCreated = 0x80000000, 00077 OET_ObjectDestroyed = 0x40000000, 00078 OET_ObjectMoved = 0x00000100, 00079 OET_AttributeChanged = 0x00000001, 00080 OET_RegistryChanged = 0x00000002, 00081 OET_RelationChanged = 0x00000008, 00082 OET_PropertyChanged = 0x00000010, 00083 OET_ChildAdded = 0x00000004, 00084 OET_ChildLost = 0x00000200, 00085 OET_ObjectReferenced = 0x00000400, 00086 OET_ObjectReleased = 0x00002000, 00087 OET_ObjectIncluded = 0x00001000, 00088 OET_ObjectExcluded = 0x00008000, 00089 OET_ObjectConnected = 0x00000800, 00090 OET_ObjectDisconnected = 0x00004000, 00091 OET_DescendantCreated = 0x00000020, 00092 OET_ModelClosed = 0x00800000, 00093 OET_All = 0xFFFFFFFF 00094 }; 00095 00096 typedef unsigned long ObjectEventTypes; 00097 00098 //############################################################################################################################################### 00099 // 00100 // E N U M E R A T I O N : MON::ConstraintDepth 00101 // 00102 //############################################################################################################################################### 00103 00104 enum ConstraintDepth 00105 { 00106 CD_Zero, 00107 CD_One, 00108 CD_Any 00109 }; 00110 00111 //############################################################################################################################################### 00112 // 00113 // E N U M E R A T I O N : MON::ConstraintPriority 00114 // 00115 //############################################################################################################################################### 00116 00117 typedef unsigned short ConstraintPriority; 00118 00119 }; // namespace MON 00120 00121 MON::ObjectEventType& operator ++( MON::ObjectEventType& eType, int ); 00122 MON::ObjectEventType& operator ++( MON::ObjectEventType& eType ); 00123 bool isAll( const std::set<MON::ObjectEventType>& setEvents ); 00124 bool isNone( const std::set<MON::ObjectEventType>& setEvents ); 00125 std::string toString( const MON::ObjectEventType& eType ); 00126 MON::ObjectEventTypes copy( const std::set<MON::ObjectEventType>& setEvents ); 00127 std::set<MON::ObjectEventType> copy( MON::ObjectEventTypes ulEvents ); 00128 00129 std::string toString( MON::ObjectType eType, bool bWithNameSpace = true ); 00130 00131 namespace BON 00132 { 00133 00134 //############################################################################################################################################### 00135 // 00136 // E N U M E R A T I O N : BON::ObjectStatus 00137 // 00138 //############################################################################################################################################### 00139 00140 enum ObjectStatus 00141 { 00142 OST_Exists = 0, 00143 OST_Deleted, 00144 OST_Zombie, 00145 OST_Null 00146 }; 00147 00148 //############################################################################################################################################### 00149 // 00150 // E N U M E R A T I O N : BON::ObjectType 00151 // 00152 //############################################################################################################################################### 00153 00154 enum ObjectType 00155 { 00156 OT_Null = 0, 00157 OT_Model = 1, 00158 OT_Atom = 2, 00159 OT_Reference = 3, 00160 OT_Connection = 4, 00161 OT_Set = 5, 00162 OT_Folder = 6 00163 }; 00164 00165 //############################################################################################################################################### 00166 // 00167 // E N U M E R A T I O N : BON::AttributeStatus 00168 // 00169 //############################################################################################################################################### 00170 00171 typedef long AttributeStatus; 00172 00173 const long AS_Here = 0; 00174 const long AS_Meta = -1; 00175 const long AS_Undefined= -2; 00176 00177 //############################################################################################################################################### 00178 // 00179 // E N U M E R A T I O N : BON::RegistryNodeStatus 00180 // 00181 //############################################################################################################################################### 00182 00183 typedef long RegistryNodeStatus; 00184 00185 const long RNS_Here = 0; 00186 const long RNS_Meta = -1; 00187 const long RNS_Undefined = -2; 00188 00189 //############################################################################################################################################### 00190 // 00191 // C L A S S : BON::Point 00192 // 00193 //############################################################################################################################################### 00194 00195 typedef unsigned long ULong; 00196 typedef std::pair<ULong, ULong> Point; 00197 00198 //############################################################################################################################################### 00199 // 00200 // E N U M E R A T I O N : BON::NamePosition 00201 // 00202 //############################################################################################################################################### 00203 00204 enum NamePosition 00205 { 00206 NP_North = 0, 00207 NP_NorthEast, 00208 NP_East, 00209 NP_SouthEast, 00210 NP_South, 00211 NP_SouthWest, 00212 NP_West, 00213 NP_NorthWest, 00214 NP_Center 00215 }; 00216 00217 //############################################################################################################################################### 00218 // 00219 // E N U M E R A T I O N : BON::AutoRouterPref 00220 // 00221 //############################################################################################################################################### 00222 00223 enum AutoRouterPref 00224 { 00225 ARP_North, 00226 ARP_South, 00227 ARP_West, 00228 ARP_East 00229 }; 00230 00231 //############################################################################################################################################### 00232 // 00233 // E N U M E R A T I O N : BON::LineType 00234 // 00235 //############################################################################################################################################### 00236 00237 enum LineType 00238 { 00239 LT_Solid, 00240 LT_Dash 00241 }; 00242 00243 //############################################################################################################################################### 00244 // 00245 // E N U M E R A T I O N : BON::LineEndType 00246 // 00247 //############################################################################################################################################### 00248 00249 enum LineEndType 00250 { 00251 LET_Butt, 00252 LET_Arrow, 00253 LET_Diamond, 00254 LET_Apex, 00255 LET_Bullet, 00256 LET_EmptyDiamond, 00257 LET_EmptyApex, 00258 LET_EmptyBullet, 00259 LET_LeftHalfArrow, 00260 LET_RightHalfArrow 00261 }; 00262 00263 }; // namespace BON 00264 00265 std::string toString( BON::ObjectType eType, bool bWithNameSpace = true ); 00266 00267 #endif // Common_h