1 // Copyright (C) 2006-2014 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef __SALOMEHPCONTAINERTOOLS_HXX__
21 #define __SALOMEHPCONTAINERTOOLS_HXX__
23 #include "YACSRuntimeSALOMEExport.hxx"
24 #include "SalomeContainerHelper.hxx"
26 #include "AutoRefCnt.hxx"
36 class SalomeComponent;
37 class SalomeContainerMonoHelper;
38 class SalomeHPContainerVectOfHelper
41 std::size_t size() const { return _launchModeType.size(); }
42 void resize(std::size_t sz);
43 std::size_t getNumberOfFreePlace() const;
44 void allocateFor(const std::vector<const Task *>& nodes);
45 void release(const Task *node);
46 std::size_t locateTask(const Task *node) const;
47 const SalomeContainerMonoHelper *at(std::size_t pos) const { checkPosInVec(pos); return _launchModeType[pos]; }
48 SalomeContainerMonoHelper *at(std::size_t pos) { checkPosInVec(pos); return _launchModeType[pos]; }
49 const SalomeContainerMonoHelper *getHelperOfTask(const Task *node) const;
50 SalomeContainerMonoHelper *getHelperOfTask(const Task *node);
52 void checkNoCurrentWork() const;
53 void checkPosInVec(std::size_t pos) const;
55 std::vector<bool> _whichOccupied;
56 std::vector< BASES::AutoRefCnt<YACS::ENGINE::SalomeContainerMonoHelper> > _launchModeType;
57 std::map<const Task *,std::size_t > _currentlyWorking;