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

CdbBdbSOi.hh

Go to the documentation of this file.
00001 #ifndef CDBBDBSHARED_OI_HH
00002 #define CDBBDBSHARED_OI_HH
00003 
00004 // File and Version Information:
00005 //      $Id: CdbBdbSOi.hh,v 1.6 2004/08/06 05:54:25 bartoldu Exp $
00006 
00007 #include "BdbUtil/Bdb.hh"
00008 
00009 #include "CdbBase/CdbCommon.hh"
00010 
00011 #include "BdbTime/BdbTime.hh"
00012 #include "BdbCond/BdbObject.hh"
00013 
00014 #include <iostream>
00015 
00016 /// Objects of this class represent "original" intervals
00017 /**
00018   * This is an embedded class.
00019   *
00020   * The "original" intervals store the original validity interval and other
00021   * information for the objects stored in the database.
00022   */
00023 class CdbBdbSOi {
00024 
00025 public:
00026 
00027   /// Default constructor
00028   /**
00029     */
00030     CdbBdbSOi( ) :
00031         begin   (BdbTime::minusInfinity),
00032         end     (BdbTime::minusInfinity),
00033         inserted(BdbTime::minusInfinity),
00034         object  (0)
00035     { }
00036 
00037   /// Normal constructor
00038   /**
00039     */
00040     CdbBdbSOi( const BdbTime&           theBeginTime,
00041                const BdbTime&           theEndTime,
00042                const BdbTime&           theInsertionTime,
00043                const BdbRef(BdbObject)& theObjectRef ) :
00044         begin   (theBeginTime),
00045         end     (theEndTime),
00046         inserted(theInsertionTime),
00047         object  (theObjectRef)
00048     { }
00049 
00050   /// Copy constructor
00051   /**
00052     */
00053     CdbBdbSOi( const CdbBdbSOi& theInterval ) :
00054         begin   (theInterval.begin),
00055         end     (theInterval.end),
00056         inserted(theInterval.inserted),
00057         object  (theInterval.object)
00058     { }
00059 
00060   /// The destructor
00061   /**
00062     * NOTE: The destructor is NOT virtual because this is an embedded
00063     *       class.
00064     */
00065     ~CdbBdbSOi( ) { }
00066 
00067   /// The assignment operator
00068   /**
00069     */
00070     CdbBdbSOi& operator=( const CdbBdbSOi& theInterval )
00071     {
00072         if( this != &theInterval ) {
00073             begin    = theInterval.begin;
00074             end      = theInterval.end;
00075             inserted = theInterval.inserted;
00076             object   = theInterval.object;
00077         }
00078         return *this;
00079     }
00080 
00081 public:
00082 
00083     BdbTime begin;              // Begin of the "validity" period
00084     BdbTime end;                // End   of the "validity" period
00085 
00086     BdbTime inserted;           // The time when the object was inserted
00087 
00088     BdbRef(BdbObject) object;   // A reference to the object
00089 };
00090 
00091 inline
00092 std::ostream&
00093 operator<<( std::ostream&         o,
00094             const CdbBdbSOi& theInterval )
00095 {
00096     o << "[ " << theInterval.begin.getGmtSec( ) << "." << theInterval.begin.getGmtNsec( ) << " , "
00097       <<         theInterval.end.getGmtSec( )   << "." << theInterval.end.getGmtNsec( )   << " ) -> "
00098       << theInterval.object.sprint( ) << " : "
00099       << theInterval.inserted.getGmtSec( ) << "." << theInterval.inserted.getGmtNsec( ) << std::endl;
00100     return o;
00101 }
00102 
00103 #endif  // CDBBDBSHARED_OI_HH

Generated on Mon Dec 5 18:22:02 2005 for CDB by doxygen1.3-rc3