00001 #ifndef CDBBDB_OBJECT_CREATOR_HH 00002 #define CDBBDB_OBJECT_CREATOR_HH 00003 00004 // File and Version Information: 00005 // $Id: CdbBdbObjectCreator.hh,v 1.3 2005/09/15 05:06:26 gapon Exp $ 00006 00007 #include "CdbBase/CdbObjectPtrFwd.hh" 00008 #include "CdbBase/CdbConditionPtrFwd.hh" 00009 00010 #include "BdbCond/BdbObject.hh" 00011 00012 class BdbTime; 00013 00014 /// This is a trait class for creating objects 00015 /** 00016 * This trait class provides object hint/creation/verification services to CDB API 00017 * implementaions related to the current persistent technology. 00018 * 00019 * The interface defines the following operations: 00020 * 00021 * - providing a clustering hint object in specified context; 00022 * - constructing an object of a concrete subclass of the CdbObject class 00023 * for specified parameters (including a persistent object). 00024 */ 00025 class CdbBdbObjectCreator { 00026 00027 public: 00028 00029 /// Provide a placement hint in specified context 00030 /** 00031 * This operation may involves interactions with a database. 00032 * 00033 * @see CdbCondition 00034 * @see CdbConditionPtr 00035 * @see BdbTime 00036 * @see CdbStatus 00037 */ 00038 static CdbStatus hint( BdbRefAny& theHint, /**< a reference to the hint to be initialized */ 00039 const CdbConditionPtr& theConditionPtr, /**< a smart pointer onto a condition's API */ 00040 const BdbTime& theBegin, /**< a point where the object's validity begins from */ 00041 const BdbTime& theEnd /**< ... and finishes (exclusing) at */ 00042 ); 00043 00044 /// Verify if specified placement hint and persistent objects match each other 00045 /** 00046 * This operation is meant to verify of specified persistent object was 00047 * properly created in the place suggested by the hint. 00048 * 00049 * This operation may involves interactions with a database. 00050 * 00051 * @see CdbStatus 00052 */ 00053 static CdbStatus verify( const BdbRefAny& theHint, /**< a reference to the hint */ 00054 const BdbHandle(BdbObject)& thePersObj, /**< a reference onto a persistent object */ 00055 const CdbConditionPtr& theConditionPtr /**< a smart pointer onto a condition's API */ 00056 ); 00057 00058 /// Build an object of a concrete class from specified parameters 00059 /** 00060 * This operation may involves interactions with a database. 00061 * 00062 * @see CdbCondition 00063 * @see CdbConditionPtr 00064 * @see CdbObject 00065 * @see CdbObjectPtr 00066 * @see BdbTime 00067 * @see CdbStatus 00068 */ 00069 static CdbStatus object( CdbObjectPtr& theObjectPtr, /**< a smart pointer onto an object to be created */ 00070 const CdbConditionPtr& theConditionPtr, /**< a smart pointer onto a condition's API */ 00071 const BdbTime& theBeginOriginalValidity, /**< a point where the object's 'original' validity begins from */ 00072 const BdbTime& theEndOriginalValidity, /**< ... and finishes (exclusing) at */ 00073 const BdbTime& theBeginValidity, /**< a point where the object's 'visible' validity begins from */ 00074 const BdbTime& theEndValidity, /**< ... and finishes (exclusing) at */ 00075 const BdbTime& theBeginDuration, /**< a point where the object's duration at insertin time begins from */ 00076 const BdbTime& theEndDuration, /**< ... and finishes (exclusing) at */ 00077 const BdbTime& theInsertionTime, /**< the time when a new object was created */ 00078 const BdbHandle(BdbObject)& thePersObj /**< a reference onto a persistent object */ 00079 ); 00080 }; 00081 00082 #endif // CDBBDB_OBJECT_CREATOR_HH
1.3-rc3