From: Anthony Geay Date: Mon, 13 Jul 2015 06:57:00 +0000 (+0200) Subject: Last commit before refactoring. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=04061ece245abfe3094eea9dc380e5f8455092e7;p=modules%2Fkernel.git Last commit before refactoring. --- diff --git a/src/SALOMESDS/SALOMESDS_Transaction.hxx b/src/SALOMESDS/SALOMESDS_Transaction.hxx index 8d1bfee4b..446803d5d 100644 --- a/src/SALOMESDS/SALOMESDS_Transaction.hxx +++ b/src/SALOMESDS/SALOMESDS_Transaction.hxx @@ -37,6 +37,8 @@ namespace SALOMESDS { public: Transaction(TransactionFactory *tf, const std::string& varName, const std::string& scopeName):_tf(tf),_var_name(varName),_scope_name(scopeName) { } + std::string getScopeName() const { return _scope_name; } + std::string getVarName() const { return _var_name; } virtual void checkAliveAndKicking(); virtual void prepareRollBackInCaseOfFailure() = 0; public: diff --git a/src/SALOMESDS/SALOMESDS_TransactionFactory.cxx b/src/SALOMESDS/SALOMESDS_TransactionFactory.cxx index 3c97b447a..01a581e36 100644 --- a/src/SALOMESDS/SALOMESDS_TransactionFactory.cxx +++ b/src/SALOMESDS/SALOMESDS_TransactionFactory.cxx @@ -59,7 +59,9 @@ SALOME::Transaction_ptr TransactionFactory::createRdOnlyVar(const char *varName, void TransactionFactory::atomicApply(const SALOME::ListOfTransaction& transactions) { std::size_t sz(transactions.length()); - std::vector< AutoServantPtr > transactionsCpp; + if(sz==0) + return ; + std::vector< AutoServantPtr > transactionsCpp(sz); for(std::size_t i=0;igetScopeName()); + for(std::size_t i=0;igetScopeName()!=scopeName) + throw Exception("TransactionFactory::atomicApply : all transactions must refer the same scope !"); for(std::size_t i=0;icheckAliveAndKicking(); }