oaDMObserver.h

Go to the documentation of this file.
00001 // *****************************************************************************
00002 // *****************************************************************************
00003 // oaDMObserver.h
00004 //
00005 // This file contains the definitions for the following observer classes:
00006 //
00007 //  oaVersionedObserver<oaLib, oacObserverVersion1>
00008 //      This class implements the observers for oaLib related operations.
00009 //
00010 //  oaVersionedObserver<oaLibDefList, oacObserverVersion1>
00011 //      This class implements the observers for the oaLibDefList operations of
00012 //      associated with opening libraries and issuing warnings while parsing a
00013 //      libDef file.
00014 //
00015 //  oaVersionedObserver<oaLibDefList, oacObserverVersion2>
00016 //      This class extends the oalibDefList version 1 observer and defines 
00017 //      additional notification actions for destroy create save and saveAs.
00018 //
00019 //  oaVersionedObserver<oaDMData, oacObserverVersion1>
00020 //      This class implements the observers for oaDMData object, supporting
00021 //      open, purge, preSave, postSave, preReopen, postReopen, and truncate
00022 //      actions.
00023 //
00024 //  oaVersionedObserver<oaViewType, oaRevisionTraits<oaViewType>::scopedObserverRevision>
00025 //      This class implements the observers for oaViewType object, supporting
00026 //      create actions.
00027 //
00028 //  oaVersionedObserver<oaViewType, oacObserverVersion1>
00029 //      This class is provided for drop-in compatibility support.
00030 //
00031 // *****************************************************************************
00032 // Except as specified in the OpenAccess terms of use of Cadence or Silicon
00033 // Integration Initiative, this material may not be copied, modified,
00034 // re-published, uploaded, executed, or distributed in any way, in any medium,
00035 // in whole or in part, without prior written permission from Cadence.
00036 //
00037 //                Copyright 2002-2005 Cadence Design Systems, Inc.
00038 //                           All Rights Reserved.
00039 //
00040 //  $Author: amirv $
00041 //  $Revision: #3 $
00042 //  $Date: 2008/10/09 $
00043 //  $State: Exp $
00044 // *****************************************************************************
00045 // *****************************************************************************
00046 
00047 
00048 
00049 #if !defined(oaDMObserver_P)
00050 #define oaDMObserver_P
00051 
00052 
00053 
00054 // *****************************************************************************
00055 // Nested includes
00056 // *****************************************************************************
00057 #include "oaObserver.h"
00058 #include "oaLibDefList.h"
00059 #include "oaLibDefListMem.h"
00060 #include "oaDMData.h"
00061 #include "oaCell.h"
00062 #include "oaCellView.h"
00063 #include "oaDMFile.h"
00064 
00065 
00066 
00067 // *****************************************************************************
00068 // Declare and define types in the OpenAccess namespace.
00069 // *****************************************************************************
00070 BEGIN_OA_NAMESPACE
00071 
00072 
00073 
00074 // *****************************************************************************
00075 // Explicit template instantiations
00076 // *****************************************************************************
00077 #if defined(OA_DM_DLL_EXTERN)
00078 OA_DM_DLL_EXTERN template
00079  class OA_DM_DLL_API oaVersionedObserver<oaCell, oaRevisionTraits<oaCell>::scopedObserverRevision>;
00080 
00081 OA_DM_DLL_EXTERN template
00082  class OA_DM_DLL_API oaVersionedObserver<oaView, oaRevisionTraits<oaView>::scopedObserverRevision>;
00083 
00084 OA_DM_DLL_EXTERN template
00085  class OA_DM_DLL_API oaVersionedObserver<oaCellView, oaRevisionTraits<oaCellView>::scopedObserverRevision>;
00086 
00087 OA_DM_DLL_EXTERN template
00088  class OA_DM_DLL_API oaVersionedObserver<oaDMFile, oaRevisionTraits<oaDMFile>::scopedObserverRevision>;
00089 
00090 OA_DM_DLL_EXTERN template
00091  class OA_DM_DLL_API oaVersionedObserver<oaLibDefListMem, oaRevisionTraits<oaLibDefListMem>::scopedObserverRevision>;
00092 
00093 #endif
00094 
00095 
00096 
00097 // *****************************************************************************
00098 // oaVersionedObserver<oaLib, oacObserverVersion1> specialization
00099 // *****************************************************************************
00100 template<>
00101 class OA_DM_DLL_API oaVersionedObserver<oaLib, oacObserverVersion1> : public oaBaseObserver {
00102 public:
00103                                                             oaVersionedObserver(oaUInt4     priorityIn,
00104                                                                                 oaBoolean   enabledIn = true);
00105     virtual                                                 ~oaVersionedObserver();
00106 
00107     virtual void                                            onPostCreate(oaLib *lib);
00108     virtual void                                            onPostOpen(oaLib *lib);
00109 
00110     virtual void                                            onPreClose(oaLib *lib);
00111 
00112     virtual void                                            onPreModify(oaLib               *lib,
00113                                                                         oaDMLibModTypeEnum  modType);
00114     virtual void                                            onPostModify(oaLib              *lib,
00115                                                                          oaDMLibModTypeEnum modType);
00116 
00117     static void                                             notifyPostCreateObservers(oaLib *lib);
00118     static void                                             notifyPostOpenObservers(oaLib *lib);
00119     static void                                             notifyPreCloseObservers(oaLib *lib);
00120     static void                                             notifyPreModifyObservers(oaLib              *lib,
00121                                                                                      oaDMLibModTypeEnum modType);
00122     static void                                             notifyPostModifyObservers(oaLib                 *lib,
00123                                                                                       oaDMLibModTypeEnum    modType);
00124 
00125 private:
00126     typedef oaVersionedObserver<oaLib, oacObserverVersion1> oaLibObserver;
00127 
00128     oaLibObserver                                           *next;
00129 
00130     static oaLibObserver                                    *first;
00131 };
00132 
00133 
00134 
00135 // *****************************************************************************
00136 // oaVersionedObserver<oaDMData, oacObserverVersion1> specialization
00137 // *****************************************************************************
00138 template<>
00139 class OA_DM_DLL_API oaVersionedObserver<oaDMData, oacObserverVersion1> : public oaBaseObserver {
00140 public:
00141                                                                 oaVersionedObserver(oaUInt4     priorityIn,
00142                                                                                     oaBoolean   enabledIn = true);
00143     virtual                                                     ~oaVersionedObserver();
00144 
00145     virtual void                                                onFirstOpen(oaDMData *dmData);
00146     virtual void                                                onPurge(oaDMData *dmData);
00147     virtual void                                                onTruncate(oaDMData *dmData);
00148     virtual void                                                onPreReopen(oaDMData    *dmData,
00149                                                                             oaChar      newMode);
00150     virtual void                                                onPostReopen(oaDMData   *dmData,
00151                                                                              oaChar     oldMode);
00152     virtual void                                                onPreSave(oaDMData *dmData);
00153     virtual void                                                onPostSave(oaDMData     *dmData,
00154                                                                            oaBoolean    succeeded);
00155 
00156     static void                                                 notifyFirstOpenObservers(oaDMData *dmData);
00157     static void                                                 notifyPurgeObservers(oaDMData *dmData);
00158     static void                                                 notifyTruncateObservers(oaDMData *dmData);
00159     static void                                                 notifyPreReopenObservers(oaDMData   *dmData,
00160                                                                                          oaChar     newMode);
00161     static void                                                 notifyPostReopenObservers(oaDMData  *dmData,
00162                                                                                           oaChar    oldMode);
00163     static void                                                 notifyPreSaveObservers(oaDMData *dmData);
00164     static void                                                 notifyPostSaveObservers(oaDMData    *dmData,
00165                                                                                         oaBoolean   succeeded);
00166 private:
00167     typedef oaVersionedObserver<oaDMData, oacObserverVersion1>  oaDMDataObserver;
00168 
00169     oaDMDataObserver                                            *next;
00170 
00171     static oaDMDataObserver                                     *first;
00172 };
00173 
00174 
00175 
00176 // *****************************************************************************
00177 // oaVersionedObserver<oaLibDefList, oacObserverVersion1> specialization
00178 // *****************************************************************************
00179 template<>
00180 class OA_DM_DLL_API oaVersionedObserver<oaLibDefList, oacObserverVersion1> : public oaBaseObserver {
00181 public:
00182                                                                     oaVersionedObserver(oaUInt4     priorityIn,
00183                                                                                         oaBoolean   enabledIn = true);
00184     virtual                                                         ~oaVersionedObserver();
00185 
00186     virtual oaBoolean                                               onPreOpenLibs(oaLibDefList *defList);
00187     virtual void                                                    onPostOpenLibs(oaLibDefList *defList);
00188 
00189     virtual oaBoolean                                               onLoadWarnings(oaLibDefList                 *defList,
00190                                                                                    const oaString               &msg,
00191                                                                                    oaLibDefListWarningTypeEnum  type);
00192 
00193     static oaBoolean                                                notifyPreOpenLibsObservers(oaLibDefList *defList);
00194     static void                                                     notifyPostOpenLibsObservers(oaLibDefList *defList);
00195     static oaBoolean                                                notifyLoadWarningsObservers(oaLibDefList                *defList,
00196                                                                                                 const oaString              &msg,
00197                                                                                                 oaLibDefListWarningTypeEnum type);
00198 
00199     static oaBoolean                                                hasObservers();
00200 // <JR> Moved up. 10/14/08         
00201         virtual void                                                    onPostCreate(oaLibDefList *defList);
00202     virtual void                                                    onPreDestroy(oaLibDefList *defList);
00203     virtual void                                                    onPreSave(oaLibDefList *defList);
00204     virtual void                                                    onPostSave(oaLibDefList *defList);
00205     virtual void                                                    onPreSaveAs(oaLibDefList    *defList,
00206                                                                                 const oaString  &name);
00207     virtual void                                                    onPostSaveAs(oaLibDefList   *defList,
00208                                                                                  const oaString &name);
00209 
00210 private:
00211     typedef oaVersionedObserver<oaLibDefList, oacObserverVersion1>  oaLibDefListObserver;
00212 
00213     oaLibDefListObserver                                            *next;
00214 
00215     static oaLibDefListObserver                                     *first;
00216 };
00217 
00218 
00219 /* <JR> 10/14/08 comment out.
00220 template<>
00221 class OA_DM_DLL_API oaVersionedObserver<oaLibDefList, oacObserverVersion2> : public
00222             oaVersionedObserver<oaLibDefList, oacObserverVersion1> {
00223 public:
00224                                                                     oaVersionedObserver(oaUInt4     priorityIn,
00225                                                                                         oaBoolean   enabledIn = true);
00226     virtual                                                         ~oaVersionedObserver();
00227 
00228     virtual void                                                    onPostCreate(oaLibDefList *defList);
00229     virtual void                                                    onPreDestroy(oaLibDefList *defList);
00230     virtual void                                                    onPreSave(oaLibDefList *defList);
00231     virtual void                                                    onPostSave(oaLibDefList *defList);
00232     virtual void                                                    onPreSaveAs(oaLibDefList    *defList,
00233                                                                                 const oaString  &name);
00234     virtual void                                                    onPostSaveAs(oaLibDefList   *defList,
00235                                                                                  const oaString &name);
00236     // Scope notifications
00237     virtual void                                                    onBeginCreate(oaObject  *session,
00238                                                                                   oaUInt4   scopeId);
00239     virtual void                                                    onEndCreate(oaLibDefList    *object,
00240                                                                                 oaUInt4         scopeId);
00241     virtual void                                                    onBeginDestroy(oaLibDefList *object,
00242                                                                                    oaUInt4      scopeId);
00243     virtual void                                                    onEndDestroy(oaObject   *session,
00244                                                                                  oaUInt4    scopeId);
00245     static void                                                     notifyPostCreateObservers(oaLibDefList *defList);
00246     static void                                                     notifyPreDestroyObservers(oaLibDefList *defList);
00247     static void                                                     notifyPreSaveObservers(oaLibDefList *defList);
00248     static void                                                     notifyPostSaveObservers(oaLibDefList *defList);
00249     static void                                                     notifyPreSaveAsObservers(oaLibDefList   *defList,
00250                                                                                              const oaString &name);
00251     static void                                                     notifyPostSaveAsObservers(oaLibDefList      *defList,
00252                                                                                               const oaString    &name);
00253     static void                                                     notifyBeginCreateObservers(oaObject *session,
00254                                                                                                oaUInt4  scopeID);
00255     static void                                                     notifyEndCreateObservers(oaLibDefList   *object,
00256                                                                                              oaUInt4        scopeID);
00257     static void                                                     notifyBeginDestroyObservers(oaLibDefList    *object,
00258                                                                                                 oaUInt4         scopeID);
00259     static void                                                     notifyEndDestroyObservers(oaObject  *session,
00260                                                                                               oaUInt4   scopeID);
00261 
00262     static oaBoolean                                                hasObservers();
00263 
00264 private:
00265     typedef oaVersionedObserver<oaLibDefList, oacObserverVersion2>  oaLibDefListObserver;
00266 
00267     oaLibDefListObserver                                            *next;
00268 
00269     static oaLibDefListObserver                                     *first;
00270 };
00271 */
00272 
00273 
00274 // *****************************************************************************
00275 // oaVersionedObserver<oaViewType, oacObserverVersion1> specialization
00276 // *****************************************************************************
00277 template<>
00278 class OA_DM_DLL_API oaVersionedObserver<oaViewType, oacObserverVersion1> : public oaBaseObserver {
00279 public:
00280                                                                     oaVersionedObserver(oaUInt4     priorityIn,
00281                                                                                         oaBoolean   enabledIn = true);
00282     virtual                                                         ~oaVersionedObserver();
00283 
00284     virtual void                                                    onPostCreate(oaViewType *viewType);
00285 
00286     static oaBoolean                                                hasObservers();
00287 
00288     static void                                                     notifyPostCreateObservers(oaViewType *viewType);
00289 
00290 private:
00291     typedef oaVersionedObserver<oaViewType, oacObserverVersion1>    oaViewTypeObserver;
00292 
00293     oaViewTypeObserver                                              *next;
00294 
00295     static oaViewTypeObserver                                       *first;
00296 };
00297 /* <TM> 6/17/07 comment out.
00298 template<>
00299 class OA_DM_DLL_API oaVersionedObserver<oaViewType, oaRevisionTraits<oaViewType>::scopedObserverRevision> : public oaVersionedObserver<oaViewType, oacObserverVersion1> {
00300 public:
00301                                                                     oaVersionedObserver(oaUInt4     priorityIn,
00302                                                                                         oaBoolean   enabledIn = true);
00303     virtual                                                         ~oaVersionedObserver();
00304 
00305     virtual void                                                    onBeginCreate(oaObject  *owner,
00306                                                                                   oaUInt4   scopeID);
00307     virtual void                                                    onEndCreate(oaViewType  *object,
00308                                                                                 oaUInt4     scopeID);
00309 
00310     static oaBoolean                                                hasObservers();
00311 
00312     static void                                                     notifyBeginCreateObservers(oaObject *database,
00313                                                                                                oaUInt4  scopeID);
00314     static void                                                     notifyEndCreateObservers(oaViewType *object,
00315                                                                                              oaUInt4    scopeID);
00316 
00317 private:
00318     typedef oaVersionedObserver<oaViewType, oaRevisionTraits<oaViewType>::scopedObserverRevision>    oaViewTypeObserver;
00319 
00320     oaViewTypeObserver                                              *next;
00321 
00322     static oaViewTypeObserver                                       *first;
00323 };
00324 */
00325 
00326 
00327 END_OA_NAMESPACE
00328 
00329 #endif

Return to top of page