1 // Copyright (C) 2006-2008 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
19 #include "ContainerTest.hxx"
20 #include "ComponentInstance.hxx"
21 #include "ToyNode.hxx"
25 using namespace YACS::ENGINE;
27 unsigned ContainerTest::_counter = 0;
29 const char ContainerTest::SUPPORTED_COMP_KIND[] = "TESTKIND1";
31 unsigned ContainerTest2::_counter = 0;
33 const char ContainerTest2::SUPPORTED_COMP_KIND[] = "TESTKIND2";
35 ContainerTest::ContainerTest():_alreadyStarted(false),_myCounter(_counter++)
39 std::string ContainerTest::getPlacementInfo() const
42 stream << "Cont#_" << _myCounter;
46 bool ContainerTest::isAlreadyStarted() const
48 return _alreadyStarted;
51 void ContainerTest::start() throw(Exception)
54 throw Exception("ContainerTest already started !!!!");
58 Container *ContainerTest::clone() const
60 if(_isAttachedOnCloning)
63 return (Container *) this;
66 return new ContainerTest;
69 void ContainerTest::checkCapabilityToDealWith(const ComponentInstance *inst) const throw(Exception)
71 if(inst->getKind()!=SUPPORTED_COMP_KIND)
72 throw Exception("ContainerTest not compatible with this type of instance.");
75 void ContainerTest::initAllContainers()
80 ContainerTest2::ContainerTest2():_alreadyStarted(false),_myCounter(_counter++)
84 bool ContainerTest2::isAlreadyStarted() const
86 return _alreadyStarted;
89 void ContainerTest2::start() throw(Exception)
92 throw Exception("ContainerTest already started !!!!");
96 Container *ContainerTest2::clone() const
98 if(_isAttachedOnCloning)
101 return (Container *) this;
104 return new ContainerTest2;
107 void ContainerTest2::initAllContainers()
112 void ContainerTest2::checkCapabilityToDealWith(const ComponentInstance *inst) const throw(Exception)
114 if(inst->getKind()!=SUPPORTED_COMP_KIND)
115 throw Exception("ContainerTest not compatible with this type of instance.");