oaPhysCollection.h

Go to the documentation of this file.
00001 // *****************************************************************************
00002 // *****************************************************************************
00003 // oaPhysCollection.h
00004 //
00005 // This file contains the definitions for collections and iterators and their
00006 // supporting classes used in phys module.
00007 //
00008 // *****************************************************************************
00009 // Except as specified in the OpenAccess terms of use of Cadence or Silicon
00010 // Integration Initiative, this material may not be copied, modified,
00011 // re-published, uploaded, executed, or distributed in any way, in any medium,
00012 // in whole or in part, without prior written permission from Cadence.
00013 //
00014 //                Copyright 2003-2005 Cadence Design Systems, Inc.
00015 //                           All Rights Reserved.
00016 //
00017 //  $Author: icftcm $
00018 //  $Revision: #1 $
00019 //  $Date: 2010/08/09 $
00020 //  $State: Exp $
00021 // *****************************************************************************
00022 // *****************************************************************************
00023 
00024 
00025 
00026 #if !defined(oaPhysCollection_P)
00027 #define oaPhysCollection_P
00028 
00029 
00030 
00031 // *****************************************************************************
00032 // Nested includes
00033 // *****************************************************************************
00034 #include "oaBlockObject.h"
00035 
00036 
00037 
00038 // *****************************************************************************
00039 // Declare and define types in the OpenAccess namespace.
00040 // *****************************************************************************
00041 BEGIN_OA_NAMESPACE
00042 
00043 
00044 
00045 // *****************************************************************************
00046 // Constant definitions and declarations
00047 // *****************************************************************************
00048 #define oavMarkerIterDataSize           16
00049 
00050 
00051 
00052 // *****************************************************************************
00053 // oaCollection<oaBlockObject, oaMarker>
00054 //
00055 // These are the definitions of a specialized oaCollection<> class.
00056 // *****************************************************************************
00057 template <>
00058 class OA_DESIGN_DLL_API oaCollection<oaBlockObject, oaMarker> {
00059 public:
00060                             oaCollection(void *object);
00061                             oaCollection(const oaCollection<oaBlockObject, oaMarker> &c);
00062 
00063     oaUInt4                 getCount() const;
00064     oaBoolean               isEmpty() const;
00065     oaBoolean               includes(const oaBlockObject *object) const;
00066 
00067     void                    *object;
00068 };
00069 
00070 
00071 
00072 // *****************************************************************************
00073 // oaBlockObjectIter
00074 //
00075 // This is the base class for oaIter<oaDesignObject>.
00076 // *****************************************************************************
00077 class OA_DESIGN_DLL_API oaBlockObjectIter {
00078 public:
00079                             oaBlockObjectIter(const oaCollection<oaBlockObject, oaMarker> &c);
00080                             oaBlockObjectIter(const oaBlockObjectIter &iter);
00081 
00082     oaBlockObject           *getNext();
00083     void                    reset();
00084 
00085 private:
00086     void                    *tbl;
00087     oaUInt4                 index;
00088     oaUInt4                 ownerIndex;
00089     oaUInt4                 ownerDataType;
00090 };
00091 
00092 
00093 
00094 
00095 // *****************************************************************************
00096 // oaIter<oaBlockObject>
00097 //
00098 // These are the specialized definitions of an oaIter<> class.
00099 // *****************************************************************************
00100 template <>
00101 class OA_DESIGN_DLL_API oaIter<oaBlockObject> : public oaBlockObjectIter {
00102 public:
00103                             oaIter(const oaCollection<oaBlockObject, oaMarker> &c);
00104                             oaIter(const oaIter<oaBlockObject> &iter);
00105 };
00106 
00107 
00108 
00109 // *****************************************************************************
00110 // oaCollection<oaMarker, oaBlockObject>
00111 //
00112 // These are the specialized definitions of an oaCollection<> class and its
00113 // methods.
00114 // *****************************************************************************
00115 template <>
00116 class OA_DESIGN_DLL_API oaCollection<oaMarker, oaBlockObject> {
00117 public:
00118                             oaCollection(const oaObject *obj);
00119                             oaCollection(const oaCollection<oaMarker, oaBlockObject> &c);
00120 
00121     oaUInt4                 getCount() const;
00122     oaBoolean               isEmpty() const;
00123     oaBoolean               includes(const oaMarker *marker) const;
00124 
00125 private:
00126     void                    *objTbl;
00127     oaUInt4                 objIndex;
00128 
00129     friend class oaIter<oaMarker>;
00130 };
00131 
00132 
00133 
00134 // *****************************************************************************
00135 // oaIter<oaMarker>
00136 //
00137 // This is oaMarker specialization of oaIter<>.
00138 // *****************************************************************************
00139 template <>
00140 class OA_DESIGN_DLL_API oaIter<oaMarker> {
00141 public:
00142                             oaIter(const oaCollection<oaMarker, oaBlock> &c);
00143                             oaIter(const oaCollection<oaMarker, oaBlockObject> &c);
00144                             oaIter(const oaIter<oaMarker> &iterIn);
00145 
00146     oaMarker                *getNext();
00147     void                    reset();
00148 
00149 private:
00150     struct oaMarkerIterData {
00151         oaMarkerMemTbl      *memTbl;
00152         oaUInt4             objType;
00153         oaUInt4             objIndex;
00154     };
00155 
00156     enum oaMarkerIterTypeEnum {
00157         oacDesignIterType   = 0,
00158         oacObjectIterType   = 1,
00159         oacEmptyIterType    = 2
00160     };
00161 
00162 
00163     oaMarkerIterData        *data() const;
00164 
00165     void                    *tbl;
00166     oaMarkerIterTypeEnum    type;
00167     oaUInt4                 i;
00168     oaByte                  dataP[oavMarkerIterDataSize];
00169 };
00170 
00171 
00172 
00173 // *****************************************************************************
00174 // oaCollection<oaPinFig, oaPin>
00175 //
00176 // These are the specialized definitions of an oaCollection<> class and its
00177 // methods.
00178 // *****************************************************************************
00179 template <>
00180 class OA_DESIGN_DLL_API oaCollection<oaPinFig, oaPin> {
00181 public:
00182                             oaCollection(const oaPin *pin);
00183                             oaCollection(const oaCollection<oaPinFig, oaPin> &c);
00184 
00185     oaUInt4                 getCount() const;
00186     oaBoolean               isEmpty() const;
00187     oaBoolean               includes(const oaFig *object) const;
00188 
00189 private:
00190     void                    *tbl;
00191     oaUInt4                 index;
00192 
00193     friend class oaIter<oaPinFig>;
00194 };
00195 
00196 
00197 
00198 // *****************************************************************************
00199 // oaIter<oaPinFig>
00200 //
00201 // This is the oaPinFig specialization of oaIter<>.
00202 // *****************************************************************************
00203 template <>
00204 class OA_DESIGN_DLL_API oaIter<oaPinFig> {
00205 public:
00206                             oaIter(const oaCollection<oaPinFig, oaPin> &cl);
00207                             oaIter(const oaIter<oaPinFig> &iterIn);
00208 
00209     oaPinFig                *getNext();
00210     void                    reset();
00211 
00212 private:
00213     void                    *tbl;
00214     oaUInt4                 index;
00215     oaUInt4                 eIndex;
00216 };
00217 
00218 
00219 
00220 END_OA_NAMESPACE
00221 
00222 #endif

Return to top of page