![]() |
![]() |
00001 #ifndef INCLUDE_ORA_SEQUENCEMANAGER_H 00002 #define INCLUDE_ORA_SEQUENCEMANAGER_H 00003 00004 #include "Exception.h" 00005 // 00006 #include <boost/shared_ptr.hpp> 00007 00008 namespace coral { 00009 class ISchema; 00010 } 00011 00012 namespace ora { 00013 00014 class Sequences; 00015 class OraSequenceTable; 00016 00017 class SequenceManager { 00018 public: 00019 00020 // 00021 SequenceManager( const std::string& tableName, coral::ISchema& schema ); 00022 00023 // 00024 SequenceManager( const SequenceManager& rhs ); 00025 00027 virtual ~SequenceManager(); 00028 00030 SequenceManager& operator=( const SequenceManager& rhs ); 00031 00033 std::string tableName(); 00034 00036 void create( const std::string& sequenceName ); 00037 00039 int getNextId( const std::string& sequenceName, bool sinchronize = false ); 00040 00042 void sinchronize( const std::string& sequenceName ); 00043 00045 void sinchronizeAll(); 00046 00048 void erase( const std::string& sequenceName ); 00049 00051 void clear(); 00052 00053 private: 00054 00055 boost::shared_ptr<OraSequenceTable> m_table; 00056 boost::shared_ptr<Sequences> m_impl; 00057 00058 }; 00059 00060 } 00061 00062 #endif