oaDMFile.h

Go to the documentation of this file.
00001 // *****************************************************************************
00002 // *****************************************************************************
00003 // oaDMFile.h
00004 //
00005 // This file contains the definition for the oaDMFile class and its public
00006 // supporting classes. The oaDMFile class represents a managed file. The
00007 // public supporting classes include:
00008 //
00009 // oaDMLockStatus
00010 //
00011 //     This class implements an enumerated type that describes the lock status.
00012 //
00013 // *****************************************************************************
00014 // Except as specified in the OpenAccess terms of use of Cadence or Silicon
00015 // Integration Initiative, this material may not be copied, modified,
00016 // re-published, uploaded, executed, or distributed in any way, in any medium,
00017 // in whole or in part, without prior written permission from Cadence.
00018 //
00019 //                Copyright 2002-2008 Cadence Design Systems, Inc.
00020 //                           All Rights Reserved.
00021 //
00022 //  $Author: icftcm $
00023 //  $Revision: #1 $
00024 //  $Date: 2010/08/09 $
00025 //  $State: Exp $
00026 // *****************************************************************************
00027 // *****************************************************************************
00028 
00029 
00030 
00031 #if !defined(oaDMFile_P)
00032 #define oaDMFile_P
00033 
00034 
00035 
00036 // *****************************************************************************
00037 // Nested includes
00038 // *****************************************************************************
00039 #include "oaDMModTypes.h"
00040 #include "oaDMObject.h"
00041 #include "oaSaveRecover.h"
00042 
00043 
00044 // *****************************************************************************
00045 // Declare and define types in the OpenAccess namespace.
00046 // *****************************************************************************
00047 BEGIN_OA_NAMESPACE
00048 
00049 
00050 
00051 // *****************************************************************************
00052 // oaDMLockStatus
00053 // *****************************************************************************
00054 class OA_DM_DLL_API oaDMLockStatus {
00055 public:
00056                             oaDMLockStatus(oaDMLockStatusEnum valueIn);
00057 
00058     const oaString          &getName() const;
00059 
00060                             operator                oaDMLockStatusEnum() const;
00061 
00062 private:
00063     oaDMLockStatusEnum      value;
00064 
00065     static const oaString   names[];
00066 };
00067 
00068 
00069 
00070 // *****************************************************************************
00071 // oaDMFile
00072 // *****************************************************************************
00073 class OA_DM_DLL_API oaDMFile : public oaDMObject {
00074 public:
00075     static oaDMFile                     *find(const oaDMContainer   *parent,
00076                                               const oaString        &name);
00077 
00078     static oaDMFile                     *create(const oaDMContainer *parent,
00079                                                 const oaString      &name,
00080                                                 const oaString      &srcPath);
00081     static oaDMFile                     *create(const oaDMContainer *parent,
00082                                                 const oaString      &name);
00083 
00084     void                                destroy();
00085     void                                destroy(oaSaveRecoverType type);
00086 
00087     oaDMContainer                       *getParent() const;
00088     void                                getName(oaString &name) const;
00089     void                                getPath(oaString &path) const;
00090     void                                getPath(oaSaveRecoverType   type,
00091                                                 oaString            &path) const;
00092     oaDMFile                            *getLeader() const;
00093 
00094     oaBoolean                           isLeader() const;
00095     oaBoolean                           isPrimary() const;
00096 
00097     oaBoolean                           existsOnDisk() const;
00098     oaBoolean                           existsOnDisk(oaSaveRecoverType type) const;
00099     oaUInt8                             getOnDiskSize() const;
00100 
00101     void                                setLeader(oaDMFile *leader);
00102 
00103     oaBoolean                           getLock();
00104     void                                releaseLock();
00105     oaDMLockStatus                      getLockStatus() const;
00106 
00107     oaVCVersion                         getVersion() const;
00108 
00109     oaCollection<oaDMFile, oaDMFile>    getFollowers() const;
00110 
00111     enum {dtIndex = oacDMFileDataType};
00112 };
00113 
00114 
00115 
00116 // *****************************************************************************
00117 // Traits
00118 // *****************************************************************************
00119 template<>
00120 class oaTraits<oaDMFile> {
00121 public:
00122     typedef oaDMObject          parentType;
00123     typedef oaDMFileModTypeEnum modTypeType;
00124     enum {dbType = oacLibDBType};
00125     enum {domain = oacNoDomain};
00126     enum {isMultiDomain = false};
00127     enum {dtIndex = oacDMFileDataType};
00128     enum {isConcrete = true};
00129     enum {objectTypeEnumVal = oacDMFileType};
00130     enum {dataTypeEnumVal = oacDMFileDataType};
00131 };
00132 
00133 
00134 
00135 END_OA_NAMESPACE
00136 
00137 #endif

Return to top of page