00001 // ***************************************************************************** 00002 // ***************************************************************************** 00003 // oaGroup.h 00004 // 00005 // This file contains the definitions for the oaGroup and oaGroupMember classes. 00006 // 00007 // ***************************************************************************** 00008 // Except as specified in the OpenAccess terms of use of Cadence or Silicon 00009 // Integration Initiative, this material may not be copied, modified, 00010 // re-published, uploaded, executed, or distributed in any way, in any medium, 00011 // in whole or in part, without prior written permission from Cadence. 00012 // 00013 // Copyright 2002-2005 Cadence Design Systems, Inc. 00014 // All Rights Reserved. 00015 // 00016 // $Author: icftcm $ 00017 // $Revision: #1 $ 00018 // $Date: 2010/08/09 $ 00019 // $State: Exp $ 00020 // ***************************************************************************** 00021 // ***************************************************************************** 00022 00023 00024 00025 #if !defined(oaGroup_P) 00026 #define oaGroup_P 00027 00028 00029 00030 // ***************************************************************************** 00031 // Nested includes 00032 // ***************************************************************************** 00033 #include "oaBaseModTypes.h" 00034 #include "oaObject.h" 00035 00036 00037 00038 // ***************************************************************************** 00039 // Declare and define types in the OpenAccess namespace. 00040 // ***************************************************************************** 00041 BEGIN_OA_NAMESPACE 00042 00043 00044 00045 // ***************************************************************************** 00046 // Forward Public Class Declarations 00047 // ***************************************************************************** 00048 class oaGroupDef; 00049 00050 00051 00052 // ***************************************************************************** 00053 // Control Bits for the various group iterators 00054 // ***************************************************************************** 00055 #define oacGroupIterNoDomain 0x0001u 00056 #define oacGroupIterBlockDomain 0x0002u 00057 #define oacGroupIterModDomain 0x0004u 00058 #define oacGroupIterOccDomain 0x0008u 00059 00060 00061 00062 // ***************************************************************************** 00063 // oaGroupTypeEnum 00064 // ***************************************************************************** 00065 #define oavNumGroupTypes 2 00066 00067 enum oaGroupTypeEnum { 00068 oacCollectionGroupType = 0, 00069 oacSetGroupType = 1 00070 }; 00071 00072 00073 00074 // ***************************************************************************** 00075 // oaGroupType 00076 // ***************************************************************************** 00077 class OA_BASE_DLL_API oaGroupType { 00078 public: 00079 oaGroupType(oaGroupTypeEnum valueIn); 00080 oaGroupType(const oaString &name); 00081 ~oaGroupType(); 00082 00083 const oaString &getName() const; 00084 00085 operator oaGroupTypeEnum() const; 00086 00087 private: 00088 oaGroupTypeEnum value; 00089 00090 static const oaString names[]; 00091 }; 00092 00093 00094 00095 // ***************************************************************************** 00096 // oaGroupDeleteWhenEnum 00097 // ***************************************************************************** 00098 #define oavNumGroupDeleteWhenEnums 3 00099 00100 enum oaGroupDeleteWhenEnum { 00101 oacNeverGroupDeleteWhen = 0, 00102 oacOnFirstGroupDeleteWhen = 1, 00103 oacOnLastGroupDeleteWhen = 2 00104 }; 00105 00106 00107 00108 // ***************************************************************************** 00109 // oaGroupDeleteWhen 00110 // ***************************************************************************** 00111 class OA_BASE_DLL_API oaGroupDeleteWhen { 00112 public: 00113 oaGroupDeleteWhen(oaGroupDeleteWhenEnum valueIn); 00114 oaGroupDeleteWhen(const oaString &name); 00115 ~oaGroupDeleteWhen(); 00116 00117 const oaString &getName() const; 00118 00119 operator oaGroupDeleteWhenEnum() const; 00120 00121 private: 00122 oaGroupDeleteWhenEnum value; 00123 00124 static const oaString names[]; 00125 }; 00126 00127 00128 00129 // ***************************************************************************** 00130 // oaGroup 00131 // ***************************************************************************** 00132 class OA_BASE_DLL_API oaGroup : public oaObject { 00133 public: 00134 static oaGroup *create(oaObject *database, 00135 const oaString &name, 00136 oaGroupType groupType = oacSetGroupType, 00137 oaBoolean isUniqueName = true, 00138 oaBoolean isOrdered = false, 00139 oaGroupDeleteWhen deleteWhen = oacNeverGroupDeleteWhen); 00140 static oaGroup *create(oaObject *database, 00141 const oaString &name, 00142 oaDomain domain, 00143 oaGroupType groupType = oacSetGroupType, 00144 oaBoolean isUniqueName = true, 00145 oaBoolean isOrdered = false, 00146 oaGroupDeleteWhen deleteWhen = oacNeverGroupDeleteWhen); 00147 static oaGroup *create(oaObject *database, 00148 const oaString &name, 00149 oaGroupDef *groupDef, 00150 oaGroupType groupType = oacSetGroupType, 00151 oaBoolean isUniqueName = true, 00152 oaBoolean isOrdered = false, 00153 oaGroupDeleteWhen deleteWhen = oacNeverGroupDeleteWhen); 00154 static oaGroup *create(oaObject *database, 00155 const oaString &name, 00156 oaDomain domain, 00157 oaGroupDef *groupDef, 00158 oaGroupType groupType = oacSetGroupType, 00159 oaBoolean isUniqueName = true, 00160 oaBoolean isOrdered = false, 00161 oaGroupDeleteWhen deleteWhen = oacNeverGroupDeleteWhen); 00162 00163 void destroy(); 00164 00165 void getName(oaString &name) const; 00166 oaDomain getGroupDomain() const; 00167 oaGroupType getGroupType() const; 00168 oaGroupDeleteWhen getDeleteWhen() const; 00169 oaBoolean isUniqueName() const; 00170 oaBoolean isOrdered() const; 00171 oaBoolean isEmpty() const; 00172 00173 void setName(const oaString &name); 00174 void setGroupType(oaGroupType type); 00175 void setDeleteWhen(oaGroupDeleteWhen deleteWhen); 00176 void setUniqueName(oaBoolean value); 00177 void setOrdered(oaBoolean value); 00178 void setLeader(oaGroupMember *leader = NULL); 00179 00180 oaBoolean hasDefaultConstraintGroup() const; 00181 oaConstraintGroup *getDefaultConstraintGroup() const; 00182 00183 oaObject *getOwner(); 00184 oaGroupMember *getLeader(); 00185 oaGroupDef *getDef() const; 00186 00187 oaCollection<oaGroupMember, oaGroup> getMembers() const; 00188 00189 enum {dtIndex = oacBaseGroupDataType}; 00190 enum {domain = oacNoDomain}; 00191 }; 00192 00193 00194 00195 // ***************************************************************************** 00196 // oaGroupMember 00197 // ***************************************************************************** 00198 class OA_BASE_DLL_API oaGroupMember : public oaObject { 00199 public: 00200 static oaGroupMember *create(oaGroup *group, 00201 oaObject *object, 00202 oaBoolean isLeader = false); 00203 00204 void destroy(); 00205 00206 oaBoolean isLeader(); 00207 00208 oaGroup *getGroup(); 00209 oaObject *getObject(); 00210 00211 void moveAfter(oaGroupMember *member); 00212 void moveToFirst(); 00213 00214 enum {dtIndex = oacBaseGroupMemDataType}; 00215 enum {domain = oacNoDomain}; 00216 }; 00217 00218 00219 00220 // ***************************************************************************** 00221 // Traits 00222 // ***************************************************************************** 00223 template<> 00224 class oaTraits<oaGroup> { 00225 public: 00226 typedef oaObject parentType; 00227 typedef oaGroupModTypeEnum modTypeType; 00228 enum {domain = oacNoDomain}; 00229 enum {isMultiDomain = false}; 00230 enum {dbType = oacBaseDBType}; 00231 enum {dtIndex = oacBaseGroupDataType}; 00232 enum {isConcrete = true}; 00233 enum {objectTypeEnumVal = oacGroupType}; 00234 enum {dataTypeEnumVal = oacBaseGroupDataType}; 00235 }; 00236 00237 template<> 00238 class oaTraits<oaGroupMember> { 00239 public: 00240 typedef oaObject parentType; 00241 typedef oaGroupMemberModTypeEnum modTypeType; 00242 enum {domain = oacNoDomain}; 00243 enum {isMultiDomain = false}; 00244 enum {dbType = oacBaseDBType}; 00245 enum {dtIndex = oacBaseGroupMemDataType}; 00246 enum {isConcrete = true}; 00247 enum {objectTypeEnumVal = oacGroupMemberType}; 00248 enum {dataTypeEnumVal = oacBaseGroupMemDataType}; 00249 }; 00250 00251 00252 00253 END_OA_NAMESPACE 00254 00255 #endif
Copyright © 2002 - 2010 Cadence Design Systems, Inc.
All Rights Reserved.