X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FBatch%2FBatch_BatchManagerCatalog.cxx;h=07bcd0048e59e5fcc638fff95ffbafac34cff9c4;hb=fd34d295755a0494910172324d19b2e64f3febea;hp=437be93fb7d6cd0fb89ecfa93b5dda0ec4b2fbaf;hpb=e071c8c9d9e68ea90fe984df89674dba97437c4b;p=modules%2Fkernel.git diff --git a/src/Batch/Batch_BatchManagerCatalog.cxx b/src/Batch/Batch_BatchManagerCatalog.cxx index 437be93fb..07bcd0048 100644 --- a/src/Batch/Batch_BatchManagerCatalog.cxx +++ b/src/Batch/Batch_BatchManagerCatalog.cxx @@ -1,3 +1,22 @@ +// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// /* * BatchManagerCatalog.cxx : * @@ -12,11 +31,13 @@ #include #include "Batch_BatchManagerCatalog.hxx" #include "Batch_FactBatchManager.hxx" +using namespace std; namespace Batch { pthread_mutex_t BatchManagerCatalog::_mutex = PTHREAD_MUTEX_INITIALIZER; - map * BatchManagerCatalog::_p_catalog = 0; + std::map * BatchManagerCatalog::_p_catalog = 0; + BatchManagerCatalog BatchManagerCatalog::theCatalog; // Constructeur BatchManagerCatalog::BatchManagerCatalog() @@ -27,7 +48,7 @@ namespace Batch { // Destructeur BatchManagerCatalog::~BatchManagerCatalog() { - // Nothing to do + delete BatchManagerCatalog::_p_catalog; } // Functor @@ -41,7 +62,7 @@ namespace Batch { if (pFBM) { // *** section critique *** pthread_mutex_lock(&_mutex); - if (! BatchManagerCatalog::_p_catalog) BatchManagerCatalog::_p_catalog = new map; + if (! BatchManagerCatalog::_p_catalog) BatchManagerCatalog::_p_catalog = new std::map; (*BatchManagerCatalog::_p_catalog)[type] = pFBM; pthread_mutex_unlock(&_mutex); @@ -53,7 +74,7 @@ namespace Batch { return BatchManagerCatalog::getFactBatchManager(type); } - map * BatchManagerCatalog::dict() const + std::map * BatchManagerCatalog::dict() const { return _p_catalog; } @@ -63,7 +84,7 @@ namespace Batch { ostringstream oss; oss << "::const_iterator it = (*_p_catalog).begin(); it != (*_p_catalog).end(); it++, sep=", ") { + for(std::map::const_iterator it = (*_p_catalog).begin(); it != (*_p_catalog).end(); it++, sep=", ") { oss << sep << "'" << (*it).first << "' : '" << (*it).second->__repr__() << "'"; } oss << "}>";