00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "BaBar/BaBar.hh"
00010
00011 #include "CdbBdbShared/CdbBdbSConditionP.hh"
00012 #include "CdbBdbShared/CdbBdbSClusterP.hh"
00013
00014 #include <assert.h>
00015 using std::endl;
00016 using std::ostream;
00017
00018 CdbBdbSConditionP::CdbBdbSConditionP( const char* theName,
00019 d_UShort theId,
00020 const char* theDescription,
00021 const BdbTime& theCreationTime,
00022 const BdbRef(CdbBdbSClusterP)& theClusterRef,
00023 bool isPartitionable ) :
00024 CdbBdbSCollectionElementP( theName,
00025 theId ),
00026 _description(theDescription),
00027 _created(theCreationTime),
00028 _isPartitionable(isPartitionable)
00029 {
00030 assert( 0 != theDescription );
00031 assert(( BdbTime::minusInfinity != theCreationTime ) && ( BdbTime::plusInfinity != theCreationTime ));
00032 assert( ! BdbIsNull(theClusterRef));
00033
00034 set__cluster( theClusterRef );
00035 }
00036
00037 CdbBdbSConditionP::~CdbBdbSConditionP( )
00038 { }
00039
00040 ooString(32)
00041 CdbBdbSConditionP::description( ) const
00042 {
00043 return _description;
00044 }
00045
00046 BdbTime
00047 CdbBdbSConditionP::created( ) const
00048 {
00049 return _created;
00050 }
00051
00052 bool
00053 CdbBdbSConditionP::isPartitionable( ) const
00054 {
00055 return _isPartitionable;
00056 }
00057
00058 BdbRef(CdbBdbSClusterP)
00059 CdbBdbSConditionP::cluster( ) const
00060 {
00061 return _cluster( );
00062 }
00063
00064 void
00065 CdbBdbSConditionP::dump( ostream& o ) const
00066 {
00067
00068 o << " NAME: " << name( ).head( ) << endl
00069 << " ID: " << id( ) << endl
00070 << " DESCRIPTION: " << _description.head( ) << endl
00071 << " CREATED: " << _created << endl
00072 << "MEMBER OF A CLUSTER: " << _cluster( BdbcRead )->id( ) << endl
00073 << " IS PARTITIONABLE: " << ( _isPartitionable ? "Yes" : "No" ) << endl;
00074 }
00075
00076
00077
00078