CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Sequences.h
Go to the documentation of this file.
1 #ifndef INCLUDE_ORA_SEQUENCES_H
2 #define INCLUDE_ORA_SEQUENCES_H
3 
4 //
5 #include <map>
6 #include <string>
7 
8 namespace ora {
9 
10  class IDatabaseSchema;
11 
12  class Sequences {
13  public:
14  explicit Sequences( IDatabaseSchema& dbSchema );
15  virtual ~Sequences();
16  int getNextId( const std::string& sequenceName, bool sinchronize = false );
17  void sinchronize( const std::string& sequenceName );
18  void sinchronizeAll();
19  void erase( const std::string& sequenceName );
20  void clear();
21  private:
22  std::map<std::string, int> m_lastIds;
24  };
25 
26  class NamedSequence {
27  public:
28  NamedSequence( const std::string& sequenceName, IDatabaseSchema& dbSchema );
29  virtual ~NamedSequence();
30  int getNextId( bool sinchronize = false );
31  void sinchronize();
32  void erase();
33  void clear();
34  private:
35  std::string m_name;
37  };
38 
39 
40 }
41 
42 #endif
43 
44 
Sequences(IDatabaseSchema &dbSchema)
Definition: Sequences.cc:4
NamedSequence(const std::string &sequenceName, IDatabaseSchema &dbSchema)
Definition: Sequences.cc:61
virtual ~NamedSequence()
Definition: Sequences.cc:66
void erase(const std::string &sequenceName)
Definition: Sequences.cc:53
virtual ~Sequences()
Definition: Sequences.cc:9
int getNextId(bool sinchronize=false)
Definition: Sequences.cc:69
IDatabaseSchema & m_schema
Definition: Sequences.h:23
void sinchronize(const std::string &sequenceName)
Definition: Sequences.cc:33
void sinchronizeAll()
Definition: Sequences.cc:43
std::string m_name
Definition: Sequences.h:35
Sequences m_sequences
Definition: Sequences.h:36
int getNextId(const std::string &sequenceName, bool sinchronize=false)
Definition: Sequences.cc:12
void clear()
Definition: Sequences.cc:57
std::map< std::string, int > m_lastIds
Definition: Sequences.h:22