TCommands::reverse_iterator rit =
m_Commands.rbegin();
99}
catch(exception& ex) {
100 ERR_POST_X(3,
Fatal<<
"Exception cought in ~CScopeTransaction_Impl() : " 160 "This Transaction is not a top level transaction");
177}
catch(exception& ex) {
191 "This Transaction is not a top level transaction");
194TCommands::reverse_iterator it;
203}
catch(exception& ex) {
226CScopeSubTransaction_Impl::CScopeSubTransaction_Impl(CScope_Impl& scope)
227: CScopeTransaction_Impl(scope), m_Parent(&scope.GetTransaction())
229m_Parent->AddScope(scope);
230scope.SetActiveTransaction(this);
233CScopeSubTransaction_Impl::~CScopeSubTransaction_Impl()
238void CScopeSubTransaction_Impl::AddScope(CScope_Impl& scope)
240CScopeTransaction_Impl::AddScope(scope);
241m_Parent->AddScope(scope);
243bool CScopeSubTransaction_Impl::HasScope(CScope_Impl& scope) const
245if ( CScopeTransaction_Impl::HasScope(scope) )
247return m_Parent->HasScope(scope);
250void CScopeSubTransaction_Impl::AddEditSaver(IEditSaver* saver)
252m_Parent->AddEditSaver(saver);
255void CScopeSubTransaction_Impl::Commit()
257if (!CanCommitRollBack()) {
258NCBI_THROW(CObjMgrException, eTransaction,
259"This Transaction is not a top level transaction");
261if (m_Commands.size() == 1 ) {
262m_Parent->AddCommand(*m_Commands.begin());
264unique_ptr<CMultEditCommand> cmd(new CMultEditCommand);
265cmd->AddCommands(m_Commands.begin(), m_CurCmd);
266m_Parent->AddCommand(CRef<IEditCommand>(cmd.release()));
271void CScopeSubTransaction_Impl::x_Finish()
273x_DoFinish(&*m_Parent);
void AddCommand(TCommand cmd)
virtual ~CMultEditCommand()
virtual void Do(IScopeTransaction_Impl &)
list< TCommand > TCommands
Base class for all object manager exceptions.
void x_AddScope(CScope_Impl &scope)
virtual ~CScopeTransaction_Impl()
virtual void AddCommand(TCommand cmd)
CScopeTransaction_Impl(CScope_Impl &scope, IScopeTransaction_Impl *parent)
virtual void AddScope(CScope_Impl &scope)
virtual void AddEditSaver(IEditSaver *)
void x_DoFinish(IScopeTransaction_Impl *)
CRef< IScopeTransaction_Impl > m_Parent
TCommands::iterator m_CurCmd
virtual bool x_CanCommitRollBack() const
virtual bool HasScope(CScope_Impl &scope) const
IScopeTransaction_Impl & GetTransaction()
void SetActiveTransaction(IScopeTransaction_Impl *)
virtual void CommitTransaction()=0
Called when a transaction is finished.
virtual void BeginTransaction()=0
Called when a transaction has just been started.
virtual void RollbackTransaction()=0
Called when a transaction should be undone.
virtual void AddCommand(TCommand)=0
virtual ~IScopeTransaction_Impl()
virtual void AddScope(CScope_Impl &)=0
virtual void AddEditSaver(IEditSaver *)=0
virtual bool HasScope(CScope_Impl &) const =0
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
const_iterator end() const
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
void Fatal(CExceptionArgs_Base &args)
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition of all error codes used in objmgr libraries (xobjmgr.lib, xobjutil.lib and others).
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4