00001 #ifndef CDBBDBSHARED_REVISION_P_HH 00002 #define CDBBDBSHARED_REVISION_P_HH 00003 00004 // File and Version Information: 00005 // $Id: CdbBdbSRevisionP.ddl,v 1.6 2004/05/24 18:19:29 gapon Exp $ 00006 00007 #include "BdbUtil/Bdb.hh" 00008 00009 #include "CdbBdbShared/CdbBdbSViCollectionP.hh" 00010 00011 /// The persistent incarnation for a revision 00012 /** 00013 */ 00014 class CdbBdbSRevisionP : public BdbPersObj { 00015 00016 public: 00017 00018 /// Default constructor 00019 /** 00020 * It can only be used to construct the "TOPMOST" revisions. The only optional 00021 * parameter is used when the newely created collection of topmost intervals 00022 * should be cloned from the specified one. This is the special case. 00023 * 00024 * This constructor will also create an empty collection of visible 00025 * intervals. 00026 */ 00027 CdbBdbSRevisionP( ); 00028 00029 /// Normal constructor 00030 /** 00031 * This constructor is used to construct regular (non-topmost) revisions 00032 * with specified identification and a collection of visible intervals. 00033 * The constructor will invoke a "clone" method against the passed collection 00034 * to make its own copy. 00035 * 00036 * The revision identifiers must be meaningfull, which means that the 00037 * identifier must differ from the "minusInfinity" and "plusInfinity" 00038 * (this one can be used to identify topmost revisions), and the name must 00039 * be non-zero pointer. 00040 * 00041 * The revision description must be a valid pointer. 00042 * 00043 * 00044 * Any violation of the above mentioned conditions would cause either 00045 * deliberate assertion and application crash in the constructor. 00046 */ 00047 CdbBdbSRevisionP( const BdbTime& theId, /**< The revision identifier */ 00048 const char* theName, /**< The revision name */ 00049 const BdbRef(CdbBdbSViCollectionP)& theCollectionRef, /**< The collection of "visible" intervals */ 00050 const BdbTime& theCreationTime, /**< When this revision is created */ 00051 const char* theDescription /**< The revision description */ 00052 ); 00053 00054 // Destructor 00055 00056 virtual ~CdbBdbSRevisionP( ); 00057 00058 /// Get revision identifier. 00059 /** 00060 * This identifier must be equal or greater of the insertion time of any intervals 00061 * in the revision's collection of 'visible intervals". 00062 * 00063 * The returned value may be equal to "plusInfinity" in case if the 00064 * object was constructed using default constructor ("TOPMOST" revision). 00065 */ 00066 BdbTime id( ) const; 00067 00068 /// Get revision name. 00069 /** 00070 * This name is guaranteed to be a non-zero string. 00071 */ 00072 ooString(32) name( ) const; 00073 00074 /// Get collection of "visible" intervals. 00075 /** 00076 */ 00077 BdbRef(CdbBdbSViCollectionP) collection( ) const; 00078 00079 /// Get revision creation time 00080 /** 00081 * This time may differ from the revision identifier if the revision is created 00082 * "back in time". 00083 */ 00084 BdbTime created( ) const; 00085 00086 /// Get revision name. 00087 /** 00088 * This name is guaranteed to be a non-zero string. 00089 */ 00090 ooString(32) description( ) const; 00091 00092 private: 00093 00094 /// The revision's identifiers. 00095 00096 BdbTime _id; 00097 ooString(32) _name; 00098 00099 /// The collection of "visible" intervals 00100 00101 BdbRef(CdbBdbSViCollectionP) _collectionRef; 00102 00103 // Additional descriptive information 00104 00105 BdbTime _created; 00106 ooString(32) _description; 00107 }; 00108 00109 #endif /* CDBBDBSHARED_REVISION_P_HH */
1.3-rc3