oaLib.h

Go to the documentation of this file.
00001 // *****************************************************************************
00002 // *****************************************************************************
00003 // oaLib.h
00004 //
00005 // This file contains the definition for the oaLib class and its public
00006 // supporting classes. The oaLib class implements an DM managed library. The
00007 // public supporting classes include:
00008 //
00009 //  oaLibMode
00010 //      This enum wrapper class encapsulates the modes which are available for
00011 // accessing a library.
00012 //
00013 //  oaLibAccess
00014 //     This is a utility class which indicates the library access type which
00015 // is used to obtain library access. There are two values: read and write.
00016 //
00017 //  oaLibAccessLevel
00018 //     This is a utility class which indicates the current library access level.
00019 // There are three levels: read, write, and none.
00020 //
00021 // *****************************************************************************
00022 // Except as specified in the OpenAccess terms of use of Cadence or Silicon
00023 // Integration Initiative, this material may not be copied, modified,
00024 // re-published, uploaded, executed, or distributed in any way, in any medium,
00025 // in whole or in part, without prior written permission from Cadence.
00026 //
00027 //                Copyright 2002-2007 Cadence Design Systems, Inc.
00028 //                           All Rights Reserved.
00029 //
00030 //  $Author: icftcm $
00031 //  $Revision: #1 $
00032 //  $Date: 2010/08/09 $
00033 //  $State: Exp $
00034 // *****************************************************************************
00035 // *****************************************************************************
00036 
00037 
00038 
00039 #if !defined(oaLib_P)
00040 #define oaLib_P
00041 
00042 
00043 
00044 // *****************************************************************************
00045 // Nested includes
00046 // *****************************************************************************
00047 #include "oaGroupDef.h"
00048 #include "oaDMAttribute.h"
00049 #include "oaDMObject.h"
00050 
00051 
00052 
00053 // *****************************************************************************
00054 // Declare and define types in the OpenAccess namespace.
00055 // *****************************************************************************
00056 BEGIN_OA_NAMESPACE
00057 
00058 
00059 
00060 // *****************************************************************************
00061 // oaLibMode
00062 // *****************************************************************************
00063 class OA_DM_DLL_API oaLibMode {
00064 public:
00065                             oaLibMode(oaLibModeEnum valueIn);
00066                             oaLibMode(const oaString &name);
00067                             ~oaLibMode();
00068 
00069     const oaString          &getName() const;
00070 
00071                             operator                oaLibModeEnum() const;
00072 
00073 private:
00074     oaLibModeEnum           value;
00075 
00076     static const oaString   names[];
00077 };
00078 
00079 
00080 
00081 // *****************************************************************************
00082 // oaLibAccess
00083 // *****************************************************************************
00084 class OA_DM_DLL_API oaLibAccess {
00085 public:
00086                             oaLibAccess(oaLibAccessEnum valueIn);
00087                             oaLibAccess(const oaString &name);
00088 
00089     const oaString          &getName() const;
00090 
00091                             operator                oaLibAccessEnum() const;
00092 
00093 private:
00094     oaLibAccessEnum         value;
00095 
00096     static const oaString   names[];
00097 };
00098 
00099 
00100 
00101 // *****************************************************************************
00102 // oaLibAccessLevel
00103 // *****************************************************************************
00104 class OA_DM_DLL_API oaLibAccessLevel {
00105 public:
00106                             oaLibAccessLevel(oaLibAccessLevelEnum valueIn);
00107                             oaLibAccessLevel(const oaString &name);
00108 
00109     const oaString          &getName() const;
00110 
00111                             operator                oaLibAccessLevelEnum() const;
00112 
00113 private:
00114     oaLibAccessLevelEnum    value;
00115 
00116     static const oaString   names[];
00117 };
00118 
00119 
00120 
00121 // *****************************************************************************
00122 // oaLib
00123 // *****************************************************************************
00124 class OA_DM_DLL_API oaLib : public oaDMContainer {
00125 public:
00126     static oaLib                        *create(const oaScalarName  &name,
00127                                                 const oaString      &libPath,
00128                                                 oaLibMode           mode = oacSharedLibMode,
00129                                                 const oaString      &dmSystem = "oaDMSystem",
00130                                                 const oaDMAttrArray *dmAttrList = NULL);
00131 
00132     static oaLib                        *open(const oaScalarName    &name,
00133                                               const oaString        &libPath,
00134                                               const oaString        &writePath = "",
00135                                               oaLibMode             mode = oacSharedLibMode);
00136 
00137     static oaLib                        *find(const oaScalarName &name);
00138 
00139     static oaBoolean                    exists(const oaString &libPath);
00140 
00141     void                                close();
00142 
00143     void                                getName(oaScalarName &name) const;
00144     void                                getName(const oaNameSpace   &ns,
00145                                                 oaString            &out) const;
00146 
00147     void                                getPath(oaString &path) const;
00148     void                                getFullPath(oaString &fullPath) const;
00149     void                                getWritePath(oaString &writePath) const;
00150     oaLibMode                           getMode() const;
00151     void                                getDMSystemName(oaString &dmSystem) const;
00152     void                                getAttributes(oaDMAttrArray &attrs) const;
00153 
00154     oaBoolean                           isReadable() const;
00155     oaBoolean                           isWritable() const;
00156     oaBoolean                           isMarkedToBeClosed() const;
00157 
00158     void                                setAttributes(const oaDMAttrArray &attrs);
00159 
00160     oaBoolean                           getAccess(oaLibAccess   accessType,
00161                                                   oaUInt4       timeout = 0);
00162     void                                releaseAccess();
00163     oaLibAccessLevel                    getAccessLevel() const;
00164 
00165     oaBoolean                           hasVC() const;
00166 
00167     oaUInt8                             calcVMSize() const;
00168 
00169     oaDMObjectIter                      getControlledObjects(oaVCQueryDepth depth = oacCellViewFileVCQueryDepth,
00170                                                              oaDMObject     *top = NULL,
00171                                                              oaBoolean      localOnly = false);
00172 
00173     oaDMObjectVersionRefIter            getWorkingVersions(oaVCQueryDepth depth = oacCellViewFileVCQueryDepth) const;
00174 
00175     oaCollection<oaCell, oaLib>         getCells() const;
00176     oaCollection<oaView, oaLib>         getViews() const;
00177     oaCollection<oaView, oaLib>         getViewsByName(const oaScalarName &name) const;
00178     oaCollection<oaCellView, oaLib>     getCellViews() const;
00179 
00180     oaCollection<oaGroup, oaLib>        getGroups() const;
00181     oaCollection<oaGroup, oaLib>        getGroups(oaGroupDef *def) const;
00182     oaCollection<oaGroup, oaLib>        getGroupsByName(const oaString &name) const;
00183 
00184     static oaCollection<oaLib, oaLib>   getOpenLibs();
00185 
00186     enum {dtIndex = oacLibDataType};
00187 };
00188 
00189 
00190 
00191 // *****************************************************************************
00192 // Traits
00193 // *****************************************************************************
00194 template<>
00195 class oaTraits<oaLib> {
00196 public:
00197     typedef oaDMContainer   parentType;
00198     enum {dbType = oacLibDBType};
00199     enum {domain = oacNoDomain};
00200     enum {isMultiDomain = false};
00201     enum {dtIndex = oacLibDataType};
00202     enum {dataTypeEnumVal = oacLibDataType};
00203     enum {isConcrete = true};
00204     enum {objectTypeEnumVal = oacLibType};
00205 };
00206 
00207 
00208 
00209 END_OA_NAMESPACE
00210 
00211 #endif

Return to top of page