oaConstraintGroup.h

Go to the documentation of this file.
00001 // *****************************************************************************
00002 // *****************************************************************************
00003 // oaConstraintGroup.h
00004 //
00005 // This file contains the definitions for the oaConstraintGroup and
00006 // oaConstraintGroupMem classes.
00007 //
00008 // The oaConstraintGroup class implements an ordered collection of constraints
00009 // and constraintGroup objects. A number of automatic constraint groups are
00010 // supported in the different types of databases:
00011 //
00012 // - Every object that can have constraints has an implicit constraint group
00013 //   that is returned by oaObject::getConstraintGroup.
00014 // - The oaTech, oaModule, oaDesign, oaBoundary, and oaBlock classes support
00015 //   a built-in default constraint group that is returned by the
00016 //   getDefaultConstraintGroup function on that object.
00017 // - The oaTech class supports a foundry constraint group that is returned by
00018 //   oaTech::getFoundryRules.
00019 //
00020 // All constraint groups have a unique name within a database.
00021 //
00022 // Constraint groups can be created in the design, technology, and wafer
00023 // databases.
00024 //
00025 // *****************************************************************************
00026 // Except as specified in the OpenAccess terms of use of Cadence or Silicon
00027 // Integration Initiative, this material may not be copied, modified,
00028 // re-published, uploaded, executed, or distributed in any way, in any medium,
00029 // in whole or in part, without prior written permission from Cadence.
00030 //
00031 //                Copyright 2002-2005 Cadence Design Systems, Inc.
00032 //                           All Rights Reserved.
00033 //
00034 //  $Author: icftcm $
00035 //  $Revision: #1 $
00036 //  $Date: 2010/08/09 $
00037 //  $State: Exp $
00038 // *****************************************************************************
00039 // *****************************************************************************
00040 
00041 
00042 
00043 #if !defined(oaConstraintGroup_P)
00044 #define oaConstraintGroup_P
00045 
00046 
00047 
00048 // *****************************************************************************
00049 // Nested includes
00050 // *****************************************************************************
00051 #include "oaCollection.h"
00052 #include "oaBaseCollection.h"
00053 #include "oaConstraint.h"
00054 
00055 
00056 
00057 // *****************************************************************************
00058 // Declare and define types in the OpenAccess namespace.
00059 // *****************************************************************************
00060 BEGIN_OA_NAMESPACE
00061 
00062 
00063 
00064 // *****************************************************************************
00065 // oaConstraintGroupOperatorEnum
00066 // *****************************************************************************
00067 #define oavNumConstraintGroupOperators  3
00068 
00069 enum oaConstraintGroupOperatorEnum {
00070     oacPrecedenceGroupOperator  = 0,
00071     oacAndGroupOperator         = 1,
00072     oacOrGroupOperator          = 2
00073 };
00074 
00075 
00076 
00077 // *****************************************************************************
00078 // oaConstraintGroupOperator
00079 // *****************************************************************************
00080 class OA_BASE_DLL_API oaConstraintGroupOperator {
00081 public:
00082                                     oaConstraintGroupOperator(oaConstraintGroupOperatorEnum valueIn);
00083                                     oaConstraintGroupOperator(const oaString &name);
00084                                     ~oaConstraintGroupOperator();
00085 
00086     const oaString                  &getName() const;
00087                                     operator                oaConstraintGroupOperatorEnum() const;
00088 
00089 private:
00090     static const oaString           *initNames();
00091 
00092     oaConstraintGroupOperatorEnum   value;
00093 };
00094 
00095 
00096 // *****************************************************************************
00097 // Forward Class Declarations
00098 // *****************************************************************************
00099 class oaConstraintGroupDef;
00100 class oaConstraintGroupMem;
00101 class oaConstraintGroup;
00102 class oaConstraint;
00103 class oaConstraintDef;
00104 
00105 
00106 
00107 // *****************************************************************************
00108 // oaConstraintGroup
00109 // *****************************************************************************
00110 class OA_BASE_DLL_API oaConstraintGroup : public oaObject {
00111 public:
00112     static oaConstraintGroup                                *create(oaObject        *database,
00113                                                                     const oaString  &name,
00114                                                                     oaBoolean       override = false);
00115     static oaConstraintGroup                                *create(oaObject                    *database,
00116                                                                     const oaString              &name,
00117                                                                     oaBoolean                   override,
00118                                                                     oaConstraintGroupOperator   op);
00119     static oaConstraintGroup                                *create(oaObject                    *database,
00120                                                                     oaConstraintGroupDef        *def,
00121                                                                     const oaString              &name,
00122                                                                     oaBoolean                   override = false,
00123                                                                     oaConstraintGroupOperator   op = oacPrecedenceGroupOperator);
00124     static oaConstraintGroup                                *create(oaConstraintGroupDef        *def,
00125                                                                     oaObject                    *object,
00126                                                                     oaBoolean                   override = false,
00127                                                                     oaConstraintGroupOperator   op = oacPrecedenceGroupOperator);
00128 
00129     static oaConstraintGroup                                *find(const oaObject    *database,
00130                                                                   const oaString    &name);
00131     static oaConstraintGroup                                *find(const oaObject    *database,
00132                                                                   const oaString    &name,
00133                                                                   oaBoolean         local);
00134 
00135     static oaConstraintGroup                                *find(const oaConstraintGroupDef    *def,
00136                                                                   const oaObject                *object);
00137 
00138     oaConstraintGroupDef                                    *getDef() const;
00139     oaConstraintGroupOperator                               getOperator() const;
00140 
00141     void                                                    destroy();
00142 
00143     oaBoolean                                               override() const;
00144     void                                                    getName(oaString &name) const;
00145 
00146     oaObject                                                *getOwner() const;
00147 
00148     oaCollection<oaConstraintGroupMem, oaConstraintGroup>   getMembers() const;
00149     oaCollection<oaConstraint, oaConstraintGroup>           getConstraints(const oaConstraintDef *def = NULL) const;
00150 
00151     enum {dtIndex = oacBaseConstraintGroupDataType};
00152 };
00153 
00154 
00155 
00156 // *****************************************************************************
00157 // oaConstraintGroupMem
00158 // *****************************************************************************
00159 class OA_BASE_DLL_API oaConstraintGroupMem : public oaObject {
00160 public:
00161     static oaConstraintGroupMem *create(oaConstraintGroup   *group,
00162                                         oaConstraint        *constraint,
00163                                         oaBoolean           prepend = false);
00164     static oaConstraintGroupMem *create(oaConstraintGroup   *group,
00165                                         oaConstraintGroup   *groupMem,
00166                                         oaBoolean           prepend = false);
00167 
00168     void                        destroy();
00169 
00170     oaConstraintGroup           *getConstraintGroup() const;
00171     oaObject                    *getObject() const;
00172 
00173     oaBoolean                   isImplicit() const;
00174 
00175     void                        moveAfter(oaConstraintGroupMem *member);
00176     void                        moveToFirst();
00177 
00178     enum {dtIndex = oacBaseConstraintGroupMemDataType};
00179 };
00180 
00181 
00182 
00183 // *****************************************************************************
00184 // Traits
00185 // *****************************************************************************
00186 template<>
00187 class oaTraits<oaConstraintGroup> {
00188 public:
00189     typedef oaObject                        parentType;
00190     typedef oaConstraintGroupModTypeEnum    modTypeType;
00191     enum {domain = oacNoDomain};
00192     enum {isMultiDomain = false};
00193     enum {dbType = oacBaseDBType};
00194     enum {dtIndex = oacBaseConstraintGroupDataType};
00195     enum {isConcrete = true};
00196     enum {objectTypeEnumVal = oacConstraintGroupType};
00197     enum {dataTypeEnumVal = oacBaseConstraintGroupDataType};
00198 };
00199 
00200 template<>
00201 class oaTraits<oaConstraintGroupMem> {
00202 public:
00203     typedef oaObject                        parentType;
00204     typedef oaConstraintGroupMemModTypeEnum modTypeType;
00205     enum {domain = oacNoDomain};
00206     enum {isMultiDomain = false};
00207     enum {dbType = oacBaseDBType};
00208     enum {dtIndex = oacBaseConstraintGroupMemDataType};
00209     enum {isConcrete = true};
00210     enum {objectTypeEnumVal = oacConstraintGroupMemType};
00211     enum {dataTypeEnumVal = oacBaseConstraintGroupMemDataType};
00212 };
00213 
00214 
00215 
00216 END_OA_NAMESPACE
00217 
00218 #endif

Return to top of page