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  class ISequenceTable;
12 
13  class Sequences {
14  public:
15  explicit Sequences( IDatabaseSchema& dbSchema );
16  explicit Sequences( ISequenceTable& table );
17  virtual ~Sequences();
18  void create( const std::string& sequenceName );
19  int getNextId( const std::string& sequenceName, bool sinchronize = false );
20  void sinchronize( const std::string& sequenceName );
21  void sinchronizeAll();
22  void erase( const std::string& sequenceName );
23  void clear();
24  private:
25  std::map<std::string, int> m_lastIds;
27  };
28 
29  class NamedSequence {
30  public:
31  NamedSequence( const std::string& sequenceName, IDatabaseSchema& dbSchema );
32  virtual ~NamedSequence();
33  void create();
34  int getNextId( bool sinchronize = false );
35  void sinchronize();
36  void erase();
37  void clear();
38  private:
39  std::string m_name;
41  };
42 
43 
44 }
45 
46 #endif
47 
48 
list table
Definition: asciidump.py:386
Sequences(IDatabaseSchema &dbSchema)
Definition: Sequences.cc:5
NamedSequence(const std::string &sequenceName, IDatabaseSchema &dbSchema)
Definition: Sequences.cc:71
virtual ~NamedSequence()
Definition: Sequences.cc:76
void erase(const std::string &sequenceName)
Definition: Sequences.cc:63
virtual ~Sequences()
Definition: Sequences.cc:15
int getNextId(bool sinchronize=false)
Definition: Sequences.cc:83
void sinchronize(const std::string &sequenceName)
Definition: Sequences.cc:43
ISequenceTable & m_table
Definition: Sequences.h:26
void sinchronizeAll()
Definition: Sequences.cc:53
std::string m_name
Definition: Sequences.h:39
Sequences m_sequences
Definition: Sequences.h:40
int getNextId(const std::string &sequenceName, bool sinchronize=false)
Definition: Sequences.cc:22
void clear()
Definition: Sequences.cc:67
std::map< std::string, int > m_lastIds
Definition: Sequences.h:25
void create(const std::string &sequenceName)
Definition: Sequences.cc:18