oaDMObject.h

Go to the documentation of this file.
00001 // *****************************************************************************
00002 // *****************************************************************************
00003 // oaDMObject.h
00004 //
00005 // This file contains the definitions for the oaDMObject and oaDMContainer
00006 // object classes, and their public supporting classes.  The oaDMObject class is
00007 // an abstract base for all OpenAccess DM objects. The oaDMContainer class is
00008 // the base for all classes which are file containers. The public supporting
00009 // classes include:
00010 //
00011 //  oaDMTransType
00012 //     This is a utility class which indicates the DM transaction type - read or
00013 //     write.
00014 //
00015 // *****************************************************************************
00016 // Except as specified in the OpenAccess terms of use of Cadence or Silicon
00017 // Integration Initiative, this material may not be copied, modified,
00018 // re-published, uploaded, executed, or distributed in any way, in any medium,
00019 // in whole or in part, without prior written permission from Cadence.
00020 //
00021 //                Copyright 2002-2005 Cadence Design Systems, Inc.
00022 //                           All Rights Reserved.
00023 //
00024 //  $Author: icftcm $
00025 //  $Revision: #1 $
00026 //  $Date: 2010/08/09 $
00027 //  $State: Exp $
00028 // *****************************************************************************
00029 // *****************************************************************************
00030 
00031 
00032 
00033 #if !defined(oaDMObject_P)
00034 #define oaDMObject_P
00035 
00036 
00037 
00038 // *****************************************************************************
00039 // Nested includes
00040 // *****************************************************************************
00041 #include "oaNativeNS.h"
00042 #include "oaCollection.h"
00043 #include "oaVCSystem.h"
00044 #include "oaVCQueryDepth.h"
00045 
00046 
00047 
00048 // *****************************************************************************
00049 // Declare and define types in the OpenAccess namespace.
00050 // *****************************************************************************
00051 BEGIN_OA_NAMESPACE
00052 
00053 
00054 
00055 // *****************************************************************************
00056 // oaDMObject
00057 // *****************************************************************************
00058 class OA_DM_DLL_API oaDMObject : public oaObject {
00059 public:
00060     oaBoolean               isContainer() const;
00061 
00062     oaLib                   *getLib() const;
00063     void                    getTempFile(oaString    &path,
00064                                         oaBoolean   sameFileSystem = false) const;
00065 
00066     oaUInt4                 getVCStatus(oaUInt4 mask = oacVCStatusAll) const;
00067 
00068     oaVCVersionIter         getVersions() const;
00069 
00070     void                    update(const oaVCVersion    &version,
00071                                    oaBoolean            recurse = true,
00072                                    const oaChar         *options = NULL);
00073 
00074     void                    makeEditable(oaBoolean      lock,
00075                                          oaBoolean      recurse = true,
00076                                          const oaChar   *options = NULL);
00077     void                    cancelEdit(oaBoolean    recurse = true,
00078                                        const oaChar *options = NULL);
00079     void                    commitEdits(const oaChar    *comment,
00080                                         oaBoolean       recurse = true,
00081                                         oaBoolean       keepEditable = false,
00082                                         const oaChar    *options = NULL);
00083 
00084     void                    setControlled(oaBoolean     recurse = true,
00085                                           const oaChar  *options = NULL);
00086     void                    unsetControlled(oaBoolean       recurse = true,
00087                                             oaBoolean       keepLocalRep = true,
00088                                             const oaChar    *options = NULL);
00089 
00090     enum {dbType = oacLibDBType};
00091 };
00092 
00093 
00094 
00095 // *****************************************************************************
00096 // oaDMObjectStatusRef
00097 // *****************************************************************************
00098 class OA_DM_DLL_API oaDMObjectStatusRef {
00099 public:
00100                             oaDMObjectStatusRef(oaDMObject  *obj = NULL,
00101                                                 oaUInt4     stat = 0);
00102     oaDMObject              *&getObject();
00103     oaDMObject              *getObject() const;
00104 
00105     oaUInt4                 &getStatus();
00106     oaUInt4                 getStatus() const;
00107 
00108 private:
00109     oaDMObject              *object;
00110     oaUInt4                 status;
00111 };
00112 
00113 
00114 
00115 // *****************************************************************************
00116 // oaDMObjectVersionRef
00117 // *****************************************************************************
00118 class OA_DM_DLL_API oaDMObjectVersionRef {
00119 public:
00120                             oaDMObjectVersionRef(const oaDMObject   *obj,
00121                                                  const oaVCVersion  &ver);
00122                             oaDMObjectVersionRef(const oaDMObject *obj = NULL);
00123 
00124     const oaDMObject        *&getObject();
00125     const oaDMObject        *getObject() const;
00126 
00127     oaVCVersion             &getVersion();
00128     oaVCVersion             getVersion() const;
00129 
00130 private:
00131     const oaDMObject        *object;
00132     oaVCVersion             version;
00133 };
00134 
00135 
00136 
00137 // *****************************************************************************
00138 // oaDMObjectVersionRefIter
00139 // *****************************************************************************
00140 class OA_DM_DLL_API oaDMObjectVersionRefIter {
00141 public:
00142                                 oaDMObjectVersionRefIter(const oaDMObjectVersionRefIter &iter);
00143                                 oaDMObjectVersionRefIter(void *data);
00144                                 ~oaDMObjectVersionRefIter();
00145 
00146     oaDMObjectVersionRefIter    &operator=(const oaDMObjectVersionRefIter &iter);
00147 
00148     oaDMObjectVersionRef        getNext();
00149     void                        reset();
00150 
00151 private:
00152     void                        *data;
00153 };
00154 
00155 
00156 
00157 // *****************************************************************************
00158 // oaDMObjectIter
00159 // *****************************************************************************
00160 class OA_DM_DLL_API oaDMObjectIter {
00161 public:
00162                             oaDMObjectIter(const oaDMObjectIter &iter);
00163                             oaDMObjectIter(void *data);
00164                             ~oaDMObjectIter();
00165 
00166     oaDMObjectIter          &operator=(const oaDMObjectIter &iter);
00167     oaDMObject              *getNext();
00168     void                    reset();
00169 
00170 private:
00171     void                    *data;
00172 };
00173 
00174 
00175 
00176 // *****************************************************************************
00177 // oaDMObjectStatusRefIter
00178 // *****************************************************************************
00179 class OA_DM_DLL_API oaDMObjectStatusRefIter {
00180 public:
00181                             oaDMObjectStatusRefIter(const oaDMObjectStatusRefIter &iter);
00182                             oaDMObjectStatusRefIter(void *data);
00183                             ~oaDMObjectStatusRefIter();
00184     oaDMObjectStatusRefIter &operator=(const oaDMObjectStatusRefIter &iter);
00185 
00186     oaDMObjectStatusRef     getNext();
00187     void                    reset();
00188 
00189 private:
00190     void                    *data;
00191 
00192     static oaNativeNS       ns;
00193 };
00194 
00195 
00196 
00197 // *****************************************************************************
00198 // oaDMContainer
00199 // *****************************************************************************
00200 class OA_DM_DLL_API oaDMContainer : public oaDMObject {
00201 public:
00202     oaCollection<oaDMFile, oaDMContainer>   getDMFiles() const;
00203 
00204     using                   oaDMObject::getVCStatus;
00205     oaDMObjectStatusRefIter                 getVCStatus(oaVCQueryDepth  depth,
00206                                                         oaUInt4         mask = oacVCStatusAll) const;
00207 };
00208 
00209 
00210 
00211 // *****************************************************************************
00212 // oaDMObject is the base for the DM Objects
00213 // *****************************************************************************
00214 template<>
00215 class oaTraits<oaDMObject> {
00216 public:
00217     typedef oaObject        parentType;
00218     enum {domain = oacNoDomain};
00219     enum {isMultiDomain = false};
00220     enum {isConcrete = false};
00221     enum {dbType = oacLibDBType};
00222     enum {abstractTypeEnumVal = oacDMObjectType};
00223 };
00224 
00225 template<>
00226 class oaTraits<oaDMContainer> {
00227 public:
00228     typedef oaDMObject      parentType;
00229     enum {dbType = oacLibDBType};
00230     enum {domain = oacNoDomain};
00231     enum {isMultiDomain = false};
00232     enum {isConcrete = false};
00233     enum {abstractTypeEnumVal = oacDMContainerType};
00234 };
00235 
00236 
00237 
00238 END_OA_NAMESPACE
00239 
00240 #endif

Return to top of page