CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/src/CondCore/ORA/src/Sequences.h

Go to the documentation of this file.
00001 #ifndef INCLUDE_ORA_SEQUENCES_H
00002 #define INCLUDE_ORA_SEQUENCES_H
00003 
00004 //
00005 #include <map>
00006 #include <string>
00007 
00008 namespace ora {
00009 
00010   class IDatabaseSchema;
00011 
00012   class Sequences {
00013     public:
00014     explicit Sequences( IDatabaseSchema& dbSchema );
00015     virtual ~Sequences();
00016     int getNextId( const std::string& sequenceName, bool sinchronize = false );
00017     void sinchronize( const std::string& sequenceName );
00018     void sinchronizeAll();
00019     void erase( const std::string& sequenceName );
00020     void clear();
00021     private:
00022     std::map<std::string, int> m_lastIds;
00023     IDatabaseSchema& m_schema;
00024   };
00025 
00026   class NamedSequence {
00027     public:
00028     NamedSequence( const std::string& sequenceName, IDatabaseSchema& dbSchema );
00029     virtual ~NamedSequence();
00030     int getNextId( bool sinchronize = false );
00031     void sinchronize();
00032     void erase();
00033     void clear();
00034     private:
00035     std::string m_name;
00036     Sequences m_sequences;
00037   };
00038     
00039     
00040 }
00041 
00042 #endif
00043   
00044