From 04061ece245abfe3094eea9dc380e5f8455092e7 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Mon, 13 Jul 2015 08:57:00 +0200 Subject: [PATCH] Last commit before refactoring. --- src/SALOMESDS/SALOMESDS_Transaction.hxx | 2 ++ src/SALOMESDS/SALOMESDS_TransactionFactory.cxx | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) 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(); } -- 2.39.2