oaTechObserver.h

Go to the documentation of this file.
00001 // *****************************************************************************
00002 // *****************************************************************************
00003 // oaTechObserver.h
00004 //
00005 // This file contains the definitions for the observer class
00006 //
00007 //  oaVersionedObserver<oaTech>
00008 //      This class implements the observers for technology database objects,
00009 //      supporting the notification of various actions on those objects.
00010 //
00011 // *****************************************************************************
00012 // Except as specified in the OpenAccess terms of use of Cadence or Silicon
00013 // Integration Initiative, this material may not be copied, modified,
00014 // re-published, uploaded, executed, or distributed in any way, in any medium,
00015 // in whole or in part, without prior written permission from Cadence.
00016 //
00017 //                Copyright 2002-2008 Cadence Design Systems, Inc.
00018 //                           All Rights Reserved.
00019 //
00020 //  $Author: rajeshh $
00021 //  $Revision: #8 $
00022 //  $Date: 2008/06/27 $
00023 //  $State: Exp $
00024 // *****************************************************************************
00025 // *****************************************************************************
00026 
00027 
00028 
00029 #if !defined(oaTechObserver_P)
00030 #define oaTechObserver_P
00031 
00032 
00033 
00034 // *****************************************************************************
00035 // Nested includes
00036 // *****************************************************************************
00037 #include "oaObjectArray.h"
00038 #include "oaObserver.h"
00039 #include "oaAnalysisLib.h"
00040 #include "oaOpPoint.h"
00041 #include "oaDerivedLayerParamDef.h"
00042 #include "oaDerivedLayerDef.h"
00043 #include "oaPhysicalLayer.h"
00044 #include "oaPurpose.h"
00045 #include "oaSiteDef.h"
00046 #include "oaViaDef.h"
00047 #include "oaViaSpec.h"
00048 #include "oaTechLayerHeader.h"
00049 #include "oaTechViaDefHeader.h"
00050 #include "oaViaVariantHeader.h"
00051 #include "oaDerivedLayerParam.h"
00052 
00053 
00054 
00055 // *****************************************************************************
00056 // Declare and define types in the OpenAccess namespace.
00057 // *****************************************************************************
00058 BEGIN_OA_NAMESPACE
00059 
00060 
00061 
00062 // *****************************************************************************
00063 // Conflict type enum
00064 // *****************************************************************************
00065 #define oavNumTechConflictTypes 14
00066 
00067 enum oaTechConflictTypeEnum {
00068     oacLayerNameTechConflictType            = 0,
00069     oacLayerNumTechConflictType             = 1,
00070     oacDerivedLayerTechConflictType         = 2,
00071     oacPurposeNameTechConflictType          = 3,
00072     oacPurposeNumTechConflictType           = 4,
00073     oacSiteDefNameTechConflictType          = 5,
00074     oacViaDefNameTechConflictType           = 6,
00075     oacViaSpecTechConflictType              = 7,
00076     oacAnalysisLibNameTechConflictType      = 8,
00077     oacConstraintNameTechConflictType       = 9,
00078     oacConstraintGroupNameTechConflictType  = 10,
00079     oacViaVariantNameTechConflictType       = 11,
00080     oacStdViaVariantTechConflictType        = 12,
00081     oacCustomViaVariantTechConflictType     = 13
00082 };
00083 
00084 
00085 
00086 // *****************************************************************************
00087 // oaTechConflictType
00088 // *****************************************************************************
00089 class OA_TECH_DLL_API oaTechConflictType {
00090 public:         
00091                             oaTechConflictType(oaTechConflictTypeEnum valueIn);
00092                             oaTechConflictType(const oaString &name);
00093                             ~oaTechConflictType();
00094 
00095     const oaString          &getName() const;
00096 
00097                             operator                oaTechConflictTypeEnum() const;
00098 
00099 private:
00100     static const oaString   *initNames();
00101 
00102     oaTechConflictTypeEnum  value;
00103 };
00104 
00105 
00106 
00107 // *****************************************************************************
00108 // Explicit template instantiations
00109 // *****************************************************************************
00110 #if defined(OA_TECH_DLL_EXTERN)
00111 OA_TECH_DLL_EXTERN template
00112  class OA_TECH_DLL_API oaVersionedObserver<oaAnalysisLib, oaRevisionTraits<oaAnalysisLib>::scopedObserverRevision>;
00113 
00114 OA_TECH_DLL_EXTERN template
00115  class OA_TECH_DLL_API oaVersionedObserver<oaLayer, oaRevisionTraits<oaLayer>::scopedObserverRevision>;
00116 
00117 OA_TECH_DLL_EXTERN template
00118  class OA_TECH_DLL_API oaVersionedObserver<oaOpPoint, oaRevisionTraits<oaOpPoint>::scopedObserverRevision>;
00119 
00120 OA_TECH_DLL_EXTERN template
00121  class OA_TECH_DLL_API oaVersionedObserver<oaPurpose, oaRevisionTraits<oaPurpose>::scopedObserverRevision>;
00122 
00123 OA_TECH_DLL_EXTERN template
00124  class OA_TECH_DLL_API oaVersionedObserver<oaSiteDef, oaRevisionTraits<oaSiteDef>::scopedObserverRevision>;
00125 
00126 OA_TECH_DLL_EXTERN template
00127  class OA_TECH_DLL_API oaVersionedObserver<oaTechHeader, oaRevisionTraits<oaTechHeader>::scopedObserverRevision>;
00128 
00129 OA_TECH_DLL_EXTERN template
00130  class OA_TECH_DLL_API oaVersionedObserver<oaTechLayerHeader, oaRevisionTraits<oaTechLayerHeader>::scopedObserverRevision>;
00131 
00132 OA_TECH_DLL_EXTERN template
00133  class OA_TECH_DLL_API oaVersionedObserver<oaTechViaDefHeader, oaRevisionTraits<oaTechViaDefHeader>::scopedObserverRevision>;
00134 
00135 OA_TECH_DLL_EXTERN template
00136  class OA_TECH_DLL_API oaVersionedObserver<oaViaDef, oaRevisionTraits<oaViaDef>::scopedObserverRevision>;
00137 
00138 OA_TECH_DLL_EXTERN template
00139  class OA_TECH_DLL_API oaVersionedObserver<oaViaSpec, oaRevisionTraits<oaViaSpec>::scopedObserverRevision>;
00140 
00141 OA_TECH_DLL_EXTERN template
00142  class OA_TECH_DLL_API oaVersionedObserver<oaViaVariant, oaRevisionTraits<oaViaVariant>::scopedObserverRevision>;
00143 
00144 OA_TECH_DLL_EXTERN template
00145  class OA_TECH_DLL_API oaVersionedObserver<oaViaVariantHeader, oaRevisionTraits<oaViaVariantHeader>::scopedObserverRevision>;
00146 
00147 OA_TECH_DLL_EXTERN template
00148  class OA_TECH_DLL_API oaVersionedObserver<oaDerivedLayerParam, oaRevisionTraits<oaDerivedLayerParam>::scopedObserverRevision>;
00149 
00150 #endif
00151 
00152 
00153 
00154 // *****************************************************************************
00155 // oaVersionedObserver<oaTech> specialization
00156 // *****************************************************************************
00157 template<>
00158 class OA_TECH_DLL_API oaVersionedObserver<oaTech, oacTechObserverVersion2> : public oaBaseObserver {
00159 public:
00160                                                                     oaVersionedObserver(oaUInt4 priorityIn);
00161     virtual                                                         ~oaVersionedObserver();
00162 
00163     virtual void                                                    onCreate(oaTech *tech);
00164     virtual void                                                    onFirstOpen(oaTech *tech);
00165     virtual void                                                    onPurge(oaTech *tech);
00166     virtual void                                                    onPreReopen(oaTech  *tech,
00167                                                                                 oaChar  newMode);
00168     virtual void                                                    onPostReopen(oaTech *tech,
00169                                                                                  oaChar oldMode);
00170     virtual void                                                    onTruncate(oaTech *tech);
00171     virtual void                                                    onPreSave(oaTech *tech);
00172     virtual void                                                    onPostSave(oaTech       *tech,
00173                                                                                oaBoolean    succeeded);
00174     virtual void                                                    onPreSaveAs(oaTech *tech);
00175     virtual void                                                    onPostSaveAs(oaTech     *tech,
00176                                                                                  oaBoolean  succeeded);
00177     virtual void                                                    onPreModify(oaTech              *tech,
00178                                                                                 oaTechModTypeEnum   modType);   
00179     virtual void                                                    onPostModify(oaTech             *tech,
00180                                                                                  oaTechModTypeEnum  modType);
00181 
00182     virtual void                                                    onConflict(oaTech                   *mostDerivedTech,
00183                                                                                oaTechConflictTypeEnum   conflictType,
00184                                                                                oaObjectArray            conflictingObjs);
00185     virtual void                                                    onUnboundRef(oaTech         *tech,
00186                                                                                  oaTechHeader   *header);
00187 
00188     virtual void                                                    onClearanceMeasureConflict(oaTechArray conflictingTechs);
00189     virtual void                                                    onDefaultManufacturingGridConflict(oaTechArray conflictingTechs);
00190     virtual void                                                    onGateGroundedConflict(oaTechArray conflictingTechs);
00191 
00192     virtual void                                                    onDBUPerUUConflict(oaTechArray  conflictingTechs,
00193                                                                                        oaViewType   *viewType);
00194     virtual void                                                    onUserUnitsConflict(oaTechArray conflictingTechs,
00195                                                                                         oaViewType  *viewType);
00196 
00197     virtual void                                                    onPreOpenRefs(oaTech *tech);
00198     virtual void                                                    onPostOpenRefs(oaTech *tech);
00199 
00200     virtual void                                                    onPreAttach(oaLib               *lib,
00201                                                                                 const oaScalarName  &attachLibName);
00202     virtual void                                                    onPostAttach(oaLib              *lib,
00203                                                                                  const oaScalarName &attachLibName);
00204 
00205     virtual void                                                    onPreDetach(oaLib *lib);
00206     virtual void                                                    onPostDetach(oaLib *lib);
00207 
00208     static void                                                     notifyCreateObservers(oaTech *tech);
00209     static void                                                     notifyFirstOpenObservers(oaTech *tech);
00210     static void                                                     notifyPurgeObservers(oaTech *tech);
00211     static void                                                     notifyPreReopenObservers(oaTech *tech,
00212                                                                                              oaChar newMode);
00213     static void                                                     notifyPostReopenObservers(oaTech    *tech,
00214                                                                                               oaChar    oldMode);
00215     static void                                                     notifyTruncateObservers(oaTech *tech);
00216     static void                                                     notifyPreSaveObservers(oaTech *tech);
00217     static void                                                     notifyPostSaveObservers(oaTech      *tech,
00218                                                                                             oaBoolean   succeeded);
00219     static void                                                     notifyPreSaveAsObservers(oaTech *tech);
00220     static void                                                     notifyPostSaveAsObservers(oaTech    *tech,
00221                                                                                               oaBoolean succeeded);
00222     static void                                                     notifyPreModifyObservers(oaTech             *tech,
00223                                                                                              oaTechModTypeEnum  modType);
00224     static void                                                     notifyPostModifyObservers(oaTech            *tech,
00225                                                                                               oaTechModTypeEnum modType);
00226     static void                                                     notifyConflictObservers(oaTech                  *mostDerivedTech,
00227                                                                                             oaTechConflictTypeEnum  conflictType,
00228                                                                                             const oaObjectArray     &conflictingObjs);
00229     static void                                                     notifyUnboundRefObservers(oaTech        *tech,
00230                                                                                               oaTechHeader  *header);
00231     static void                                                     notifyPreOpenRefsObservers(oaTech *tech);
00232     static void                                                     notifyPostOpenRefsObservers(oaTech *tech);
00233 
00234     static void                                                     notifyPreAttachObservers(oaLib              *lib,
00235                                                                                              const oaScalarName &attachLibName);        
00236     static void                                                     notifyPostAttachObservers(oaLib                 *lib,
00237                                                                                               const oaScalarName    &attachLibName);
00238 
00239     static void                                                     notifyPreDetachObservers(oaLib *lib);
00240     static void                                                     notifyPostDetachObservers(oaLib *lib);
00241 
00242     static void                                                     notifyClearanceMeasureConflictObservers(const oaTechArray &conflictingTechs);
00243     static void                                                     notifyDefaultManufacturingGridConflictObservers(const oaTechArray &conflictingTechs);
00244     static void                                                     notifyGateGroundedConflictObservers(const oaTechArray &conflictingTechs);
00245     static void                                                     notifyDBUPerUUConflictObservers(const oaTechArray   &conflictingTechs,
00246                                                                                                     oaViewType          *viewType);
00247     static void                                                     notifyUserUnitsConflictObservers(const oaTechArray  &conflictingTechs,
00248                                                                                                      oaViewType         *viewType);
00249 
00250                                                                     oaVersionedObserver(oaUInt4     priorityIn,
00251                                                                                         oaBoolean   enabledIn);
00252                                                                                         
00253     // <TM> 12/06 add V3 tech observer for doc workaround
00254     virtual void            onProcessFamilyConflict(const oaTechArray   &conflictedTechs);
00255     // <TM> 1/06 add V3 tech observer for doc workaround
00256     virtual void            onExcludedLayerConflict(oaTech                  *mostDerivedTech,
00257                                                     const oaPhysicalLayer   *excludingLayer,
00258                                                     const oaLayer           *excludedLayer);                                                                                       
00259 
00260 private:
00261     typedef oaVersionedObserver<oaTech, oacTechObserverVersion2>    oaTechObserver;
00262 
00263     void                                                            init();
00264 
00265     oaTechObserver                                                  *next;
00266     static oaTechObserver                                           *first;
00267 
00268 };
00269 
00270 
00271 
00272 // *****************************************************************************
00273 // oaVersionedObserver<oaTech> specialization Version 3 Observer
00274 // *****************************************************************************
00275 /* <TM> 12/06 comment out for doc workaroundtemplate<>
00276 template<>
00277 class OA_TECH_DLL_API oaVersionedObserver<oaTech, oacTechObserverVersion3> : public oaVersionedObserver<oaTech, oacTechObserverVersion2> {
00278 public:
00279                                                                     oaVersionedObserver(oaUInt4 priorityIn);
00280     virtual                                                         ~oaVersionedObserver();
00281 
00282     virtual void                                                    onProcessFamilyConflict(const oaTechArray &conflictedTechs);
00283     virtual void                                                    onExcludedLayerConflict(oaTech                  *mostDerivedTech,
00284                                                                                             const oaPhysicalLayer   *excludingLayer,
00285                                                                                             const oaLayer           *excludedLayer);
00286 
00287     static void                                                     notifyProcessFamilyConflictObservers(const oaTechArray &conflictingTechs);
00288     static void                                                     notifyExcludedLayerConflictObservers(oaTech                 *mostDerivedTech,
00289                                                                                                          const oaPhysicalLayer  *excludingLayer,
00290                                                                                                          const oaLayer          *excludedLayer);
00291 
00292                                                                     oaVersionedObserver(oaUInt4     priorityIn,
00293                                                                                         oaBoolean   enabledIn);
00294 
00295 private:
00296     typedef oaVersionedObserver<oaTech, oacTechObserverVersion3>    oaTechObserver;
00297 
00298     void                                                            init();
00299 
00300     oaTechObserver                                                  *next;
00301     static oaTechObserver                                           *first;
00302 };
00303 */
00304 
00305 
00306 // *****************************************************************************
00307 // oaTechUndoObserverBase
00308 // *****************************************************************************
00309 class OA_TECH_DLL_API oaTechUndoObserverBase {
00310 public:
00311                             oaTechUndoObserverBase();
00312     virtual                 ~oaTechUndoObserverBase();
00313 
00314     virtual void            onStartUndo(oaTech *Tech);
00315     virtual void            onEndUndo(oaTech *Tech);
00316 
00317     virtual void            onStartRedo(oaTech *Tech);
00318     virtual void            onEndRedo(oaTech *Tech);
00319 
00320     virtual void            onSetCp(oaTech    *Tech,
00321                                     oaUInt4     cpID);
00322     virtual void            onUnsetCp(oaTech *Tech);
00323 
00324     oaBoolean               isEnabled();
00325     void                    enable(oaBoolean enabledIn);
00326 
00327 protected:
00328     void                    *pImpl;
00329 };
00330 
00331 
00332 
00333 // *****************************************************************************
00334 // oaTechUndoObserver
00335 // *****************************************************************************
00336 #define oaTechUndoObserver oaTechUndoObserver<oacObserverVersion2>
00337 
00338 
00339 
00340 // *****************************************************************************
00341 // oaVersionedTechUndoObserver
00342 // *****************************************************************************
00343 template <oaUInt4 rev = oacObserverVersion2>
00344 class OA_TECH_DLL_API oaTechUndoObserver : public oaTechUndoObserverBase {
00345 public:
00346                             oaTechUndoObserver(oaUInt4   priorityIn,
00347                                                           oaBoolean enabledIn = true);
00348 };
00349 
00350 
00351 
00352 // *****************************************************************************
00353 // oaVersionedObserver<oaDerivedLayerParamDef> specialization
00354 // *****************************************************************************
00355 template<>
00356 class OA_TECH_DLL_API oaVersionedObserver<oaDerivedLayerParamDef, oacObserverVersion1> : public oaBaseObserver {
00357 public:
00358                                                                                 oaVersionedObserver(oaUInt4     priorityIn,
00359                                                                                                     oaBoolean   enabledIn = true);
00360     virtual                                                                     ~oaVersionedObserver();
00361 
00362     virtual void                                                                onPreDestroy(oaDerivedLayerParamDef *def);
00363     virtual void                                                                onPostCreate(oaDerivedLayerParamDef *def);
00364     virtual void                                                                onConflict(const oaString   &name,
00365                                                                                            oaType           valueType);
00366 
00367     static oaBoolean                                                            hasObservers();
00368 
00369     static void                                                                 notifyPreDestroyObservers(oaDerivedLayerParamDef *def);
00370     static void                                                                 notifyPostCreateObservers(oaDerivedLayerParamDef *def);
00371     static void                                                                 notifyOnConflictObservers(const oaString    &name,
00372                                                                                                           oaType            valueType);
00373 private:
00374     typedef oaVersionedObserver<oaDerivedLayerParamDef, oacObserverVersion1>    oaDerivedLayerParamDefObserver;
00375 
00376     oaDerivedLayerParamDefObserver                                              *next;
00377 
00378     static oaDerivedLayerParamDefObserver                                       *first;
00379 };
00380 /* <TM> 6/16/07 comment out for doc workaround
00381 template<>
00382 class OA_TECH_DLL_API oaVersionedObserver<oaDerivedLayerParamDef, oaRevisionTraits<oaDerivedLayerParamDef>::scopedObserverRevision> : public oaVersionedObserver<oaDerivedLayerParamDef, oacObserverVersion1> {
00383 public:
00384                                                                                 oaVersionedObserver(oaUInt4     priorityIn,
00385                                                                                                     oaBoolean   enabledIn = true);
00386     virtual                                                                     ~oaVersionedObserver();
00387 
00388     virtual void                                                                onBeginCreate(oaObject  *owner,
00389                                                                                               oaUInt4   scopeID);
00390     virtual void                                                                onEndCreate(oaDerivedLayerParamDef  *object,
00391                                                                                             oaUInt4                 scopeID);
00392     virtual void                                                                onBeginDestroy(oaDerivedLayerParamDef   *object,
00393                                                                                                oaUInt4                  scopeID);
00394     virtual void                                                                onEndDestroy(oaObject   *owner,
00395                                                                                              oaUInt4    scopeID);
00396 
00397     static oaBoolean                                                            hasObservers();
00398 
00399     static void                                                                 notifyBeginCreateObservers(oaObject *database,
00400                                                                                                            oaUInt4  scopeID);
00401     static void                                                                 notifyEndCreateObservers(oaDerivedLayerParamDef *object,
00402                                                                                                          oaUInt4                scopeID);
00403     static void                                                                 notifyBeginDestroyObservers(oaDerivedLayerParamDef  *object,
00404                                                                                                             oaUInt4                 scopeID);
00405     static void                                                                 notifyEndDestroyObservers(oaObject  *database,
00406                                                                                                           oaUInt4   scopeID);
00407 
00408 private:
00409     typedef oaVersionedObserver<oaDerivedLayerParamDef, oaRevisionTraits<oaDerivedLayerParamDef>::scopedObserverRevision>    oaDerivedLayerParamDefObserver;
00410 
00411     oaDerivedLayerParamDefObserver                                              *next;
00412 
00413     static oaDerivedLayerParamDefObserver                                       *first;
00414 };
00415 */
00416 
00417 
00418 // *****************************************************************************
00419 // oaVersionedObserver<oaDerivedLayerDef> specialization
00420 // *****************************************************************************
00421 template<>
00422 class OA_TECH_DLL_API oaVersionedObserver<oaDerivedLayerDef, oacObserverVersion1> : public oaBaseObserver {
00423 public:
00424                                                                         oaVersionedObserver(oaUInt4     priorityIn,
00425                                                                                             oaBoolean   enabledIn = true);
00426     virtual                                                             ~oaVersionedObserver();
00427 
00428     virtual void                                                        onPreDestroy(oaDerivedLayerDef *def);
00429     virtual void                                                        onPostCreate(oaDerivedLayerDef *def);
00430     virtual void                                                        onConflict(const oaString &name);
00431 
00432     static oaBoolean                                                    hasObservers();
00433 
00434     static void                                                         notifyPreDestroyObservers(oaDerivedLayerDef *def);
00435     static void                                                         notifyPostCreateObservers(oaDerivedLayerDef *def);
00436     static void                                                         notifyOnConflictObservers(const oaString &name);
00437 
00438 private:
00439     typedef oaVersionedObserver<oaDerivedLayerDef, oacObserverVersion1> oaDerivedLayerDefObserver;
00440 
00441     oaDerivedLayerDefObserver                                           *next;
00442 
00443     static oaDerivedLayerDefObserver                                    *first;
00444 };
00445 /* <TM> 6/16/07 comment out for doc workaround
00446 template<>
00447 class OA_TECH_DLL_API oaVersionedObserver<oaDerivedLayerDef, oaRevisionTraits<oaDerivedLayerDef>::scopedObserverRevision> : public oaVersionedObserver<oaDerivedLayerDef, oacObserverVersion1> {
00448 public:
00449                                                                         oaVersionedObserver(oaUInt4     priorityIn,
00450                                                                                             oaBoolean   enabledIn = true);
00451     virtual                                                             ~oaVersionedObserver();
00452 
00453     virtual void                                                        onBeginCreate(oaObject  *owner,
00454                                                                                       oaUInt4   scopeID);
00455     virtual void                                                        onEndCreate(oaDerivedLayerDef   *object,
00456                                                                                     oaUInt4             scopeID);
00457     virtual void                                                        onBeginDestroy(oaDerivedLayerDef    *object,
00458                                                                                        oaUInt4              scopeID);
00459     virtual void                                                        onEndDestroy(oaObject   *owner,
00460                                                                                      oaUInt4    scopeID);
00461 
00462     static oaBoolean                                                    hasObservers();
00463 
00464     static void                                                         notifyBeginCreateObservers(oaObject *database,
00465                                                                                                    oaUInt4  scopeID);
00466     static void                                                         notifyEndCreateObservers(oaDerivedLayerDef  *object,
00467                                                                                                  oaUInt4            scopeID);
00468     static void                                                         notifyBeginDestroyObservers(oaDerivedLayerDef   *object,
00469                                                                                                     oaUInt4             scopeID);
00470     static void                                                         notifyEndDestroyObservers(oaObject  *database,
00471                                                                                                   oaUInt4   scopeID);
00472 
00473 private:
00474     typedef oaVersionedObserver<oaDerivedLayerDef, oaRevisionTraits<oaDerivedLayerDef>::scopedObserverRevision> oaDerivedLayerDefObserver;
00475 
00476     oaDerivedLayerDefObserver                                           *next;
00477 
00478     static oaDerivedLayerDefObserver                                    *first;
00479 };
00480 */
00481 
00482 
00483 END_OA_NAMESPACE
00484 
00485 #endif

Return to top of page