1 // Copyright (C) 2006-2013 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.
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
23 #include "YACSlibEngineExport.hxx"
24 #include "Exception.hxx"
35 class YACSLIBENGINE_EXPORT Pool
37 friend class OptimizerLoop;
44 unsigned char _priority;
46 ExpData(Any *inValue, unsigned char priority);
47 ExpData(const ExpData& other);
49 Any *inValue() const { return _in; }
50 Any *outValue() const { return _out; }
51 void setOutValue(Any *outValue);
53 bool isLaunchable() const;
54 unsigned char getPriority() const { return _priority; }
56 static Any *NOT_USED_NOR_COMPUTED;
57 static Any *USED_BUT_NOT_COMPUTED_YET;
60 std::list< std::pair<int, ExpData> > _container;
61 std::list< std::pair<int, ExpData> >::iterator _currentCase;
64 int getCurrentId() const ;
65 Any *getCurrentInSample() const ;
66 Any *getCurrentOutSample() const ;
67 Any *getOutSample(int id);
68 void pushInSample(int id, Any *inSample, unsigned char priority = 0);
71 //For OptimizerNode use
72 void destroyCurrentCase();
73 void checkConsistency() throw(Exception);
74 void setCurrentId(int id) throw(Exception);
75 void putOutSampleAt(int id, Any *outValue) throw(Exception);
76 Any *getNextSampleWithHighestPriority(int& id, unsigned char& priority) const;
77 void markIdAsInUse(int id);
80 static const char MESSAGEFORUNXSTNGID[];