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

CdbHistoryEvent.hh

Go to the documentation of this file.
00001 #ifndef CDB_HISTORY_EVENT_HH
00002 #define CDB_HISTORY_EVENT_HH
00003 
00004 // File and Version Information:
00005 //      $Id: CdbHistoryEvent.hh,v 1.4 2004/08/06 05:54:14 bartoldu Exp $
00006 
00007 #include "BdbTime/BdbTime.hh"
00008 
00009 #include "CdbBase/CdbCPtrBase.hh"
00010 #include "CdbBase/CdbHistoryEventPtrFwd.hh"
00011 
00012 #include <iostream>
00013 
00014 #include <string>
00015 
00016 /// The transient interface to history events
00017 /**
00018   * The constructors of this class are hidden to prevent creating these
00019   * objects on their own. Only subclasses can call use these methods.
00020   */
00021 class CdbHistoryEvent {
00022 
00023 friend class CdbCPtrBase< CdbHistoryEvent >;   // Who destroys me.
00024 
00025 private:
00026 
00027   /// The default constructor (NOT IMPLEMENTED)
00028 
00029     CdbHistoryEvent( );
00030 
00031 protected:
00032 
00033   /// The normal constructor.
00034   /**
00035     * Initialize local context with specified parameters.
00036     *
00037     * @see BdbTime
00038     */
00039     CdbHistoryEvent( const BdbTime&     theTimeStamp,   /**< the timestamp when this even happened */
00040                      const std::string& theTypeName     /**< the name of the event */
00041                    );
00042 
00043   /// The copy constructor
00044 
00045     CdbHistoryEvent( const CdbHistoryEvent& theEvent );
00046 
00047   /// The assignment operator
00048 
00049     CdbHistoryEvent& operator=( const CdbHistoryEvent& theEvent );
00050 
00051 public:
00052 
00053   /// The destructor.
00054 
00055     virtual ~CdbHistoryEvent( );
00056 
00057   /// Return the timestamp when this even happened
00058   /**
00059     * @see BdbTime
00060     */
00061     BdbTime timeStamp( ) const { return _timestamp; }
00062 
00063   /// Return the type name of the event
00064 
00065     std::string typeName( ) const { return _typeName; }
00066 
00067   /// Dump the contents of an event onto specified stream
00068   /**
00069     * This operation will dump the local context of objects of this class.
00070     * It can be ovverriden by the subclasses.
00071     * The dump is followed by the end of line.
00072     */
00073     virtual void dump( std::ostream& theStream ) const;
00074 
00075 private:
00076 
00077     BdbTime     _timestamp;
00078     std::string _typeName;
00079 
00080 };
00081 
00082 #endif  // CDB_HISTORY_EVENT_HH

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