Bdb packages | Design docs | Source docs | Guidelines | Recent releases

Search | Site Map .

Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/BdbCond/BdbCondStoreTime.hh

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 //
00003 // File and Version Information:
00004 //      $Id: BdbCondStoreTime.hh,v 1.2 2000/04/28 00:47:03 brownd Exp $
00005 //
00006 // Description:
00007 //      Class BdbCondStoreTime. This class describes a "storing point"
00008 //      inn a vector of points to be stored through BdbDatabase::storeVector()
00009 //      interface.
00010 //
00011 //      This is "sortable" class. It means that the objects of this class
00012 //      may be sorted according to the value of the "validity time", which
00013 //      is one of two data members of the class.
00014 //
00015 // Environment:
00016 //      Software developed for the BaBar Detector at the SLAC B-Factory.
00017 //
00018 // Author List:
00019 //      Igor A. Gaponenko           Original Author
00020 //
00021 // Copyright Information:
00022 //      Copyright (C) 1999          Lawrence Berkeley Laboratory
00023 //
00024 //-----------------------------------------------------------------------------
00025 
00026 #ifndef BDBCONDSTORETIME_HH
00027 #define BDBCONDSTORETIME_HH
00028 
00029 //-----------------
00030 // BaBar Headers --
00031 //-----------------
00032 
00033 #include "BaBar/BaBar.hh"
00034 
00035 //-------------------------------
00036 // Collaborating Class Headers --
00037 //-------------------------------
00038 
00039 #include "BdbUtil/Bdb.hh"
00040 #include "BdbTime/BdbTime.hh"
00041 #include "BdbCond/BdbObject.hh"
00042 
00043 //              ---------------------
00044 //              -- Class Interface --
00045 //              ---------------------
00046 
00047 class BdbCondStoreTime {
00048 
00049 public:
00050 
00051   // Constructor(s)
00052 
00053 
00054     BdbCondStoreTime( );
00055 
00056     BdbCondStoreTime( const BdbTime&           theTime,
00057                       const BdbRef(BdbObject)& theObjectRef );
00058 
00059     BdbCondStoreTime( const BdbCondStoreTime&  theStoreTime );
00060 
00061   // Destructor
00062 
00063     virtual ~BdbCondStoreTime( );
00064 
00065   // Accessors (const)
00066 
00067     inline BdbTime           getTime( )   const;
00068     inline BdbRef(BdbObject) getObject( ) const;
00069 
00070 // delete the object (used in case of failure)
00071     void deleteObject();
00072 
00073   // Operators
00074   //
00075   //    NOTE: The comparision operators are needed to insert this class
00076   //          into the sorted collections.
00077 
00078     BdbCondStoreTime& operator=( const BdbCondStoreTime& theStoreTime );
00079 
00080     inline bool operator==( const BdbCondStoreTime& theStoreTime ) const;
00081     inline bool operator<=( const BdbCondStoreTime& theStoreTime ) const;
00082     inline bool operator<(  const BdbCondStoreTime& theStoreTime ) const;
00083     inline bool operator>(  const BdbCondStoreTime& theStoreTime ) const;
00084     inline bool operator>=( const BdbCondStoreTime& theStoreTime ) const;
00085 
00086 private:
00087 
00088   // Date members
00089 
00090     BdbTime           _time;
00091     BdbRef(BdbObject) _object;
00092 };
00093 
00094 // Inline implementations
00095 
00096 inline BdbTime
00097 BdbCondStoreTime::getTime( ) const
00098 {
00099     return _time;
00100 }
00101 
00102 inline BdbRef(BdbObject)
00103 BdbCondStoreTime::getObject( ) const
00104 {
00105     return _object;
00106 }
00107 
00108 inline bool
00109 BdbCondStoreTime::operator==( const BdbCondStoreTime& theStoreTime ) const
00110 {
00111     return _time == theStoreTime._time;
00112 }
00113 
00114 inline bool
00115 BdbCondStoreTime::operator<=( const BdbCondStoreTime& theStoreTime ) const
00116 {
00117     return _time <= theStoreTime._time;
00118 }
00119 
00120 inline bool
00121 BdbCondStoreTime::operator<(  const BdbCondStoreTime& theStoreTime ) const
00122 {
00123     return _time < theStoreTime._time;
00124 }
00125 
00126 inline bool
00127 BdbCondStoreTime::operator>(  const BdbCondStoreTime& theStoreTime ) const
00128 {
00129     return _time > theStoreTime._time;
00130 }
00131 
00132 inline bool
00133 BdbCondStoreTime::operator>=( const BdbCondStoreTime& theStoreTime ) const
00134 {
00135     return _time >= theStoreTime._time;
00136 }
00137 
00138 
00139 #endif /* BDBCONDSTORETIME_HH */

 


BaBar Public Site | SLAC | News | Links | Who's Who | Contact Us

Page Owner: Jacek Becla
Last Update: October 04, 2002