TDbiRollbackDates.hxx

Go to the documentation of this file.
00001 #ifndef DBIROLLBACKDATES_H
00002 #define DBIROLLBACKDATES_H
00003 
00004 /**
00005  *
00006  * $Id: TDbiRollbackDates.hxx,v 1.1 2011/01/18 05:49:20 finch Exp $
00007  *
00008  * \class TDbiRollbackDates
00009  *
00010  *
00011  * \brief
00012  * <b>Concept</b>  A register of rollback dates organised by table name
00013  *
00014  * \brief
00015  * <b>Purpose</b> Simplify rollback date management by extracting info.
00016  * from DBI registry and serving by table name
00017  *
00018  * Contact: A.Finch@lancaster.ac.uk
00019  *
00020  *
00021  */
00022 
00023 #include <map>
00024 #include <string>
00025 
00026 #ifndef ROOT_Rtypes
00027 #if !defined(__CINT__) || defined(__MAKECINT__)
00028 #include "Rtypes.h"
00029 #endif
00030 #endif
00031 
00032 class TDbiRegistry;
00033 
00034 class TDbiRollbackDates
00035 {
00036 
00037 public:
00038 
00039   typedef std::map<std::string,std::string> name_map_t;
00040 
00041 // Constructors and destructors.
00042            TDbiRollbackDates();
00043   virtual ~TDbiRollbackDates();
00044 
00045 // State testing member functions
00046 
00047   const std::string& GetDate(const std::string& tableName) const;
00048   const std::string& GetType(const std::string& tableName) const;
00049   void Show() const;
00050 
00051 // State changing member functions
00052 
00053   void Clear() {fTableToDate.clear(); fTableToType.clear();}
00054   void Set(TDbiRegistry& reg);  //Modifies TDbiRegistry
00055 
00056 private:
00057 
00058 // Data members
00059 
00060 /// Look-up table name -> date string
00061   name_map_t fTableToDate;
00062 /// Look-up table name -> time type (either "INSERTDATE" [default] or "CREATIONDATE")
00063   name_map_t fTableToType;
00064 
00065 ClassDef(TDbiRollbackDates,0)   // Rollback dates by table name.
00066 
00067 };
00068 
00069 
00070 
00071 #endif  // DBIROLLBACKDATES_H
00072 

Generated on 11 Aug 2013 for SKDatabase by  doxygen 1.6.1