1 #include "ContainerTest.hxx"
2 #include "ComponentInstance.hxx"
7 using namespace YACS::ENGINE;
9 unsigned ContainerTest::_counter = 0;
11 const char ContainerTest::SUPPORTED_COMP_KIND[] = "TESTKIND1";
13 unsigned ContainerTest2::_counter = 0;
15 const char ContainerTest2::SUPPORTED_COMP_KIND[] = "TESTKIND2";
17 ContainerTest::ContainerTest():_alreadyStarted(false),_myCounter(_counter++)
21 std::string ContainerTest::getPlacementInfo() const
24 stream << "Cont#_" << _myCounter;
28 bool ContainerTest::isAlreadyStarted() const
30 return _alreadyStarted;
33 void ContainerTest::start() throw(Exception)
36 throw Exception("ContainerTest already started !!!!");
40 Container *ContainerTest::clone() const
42 if(_isAttachedOnCloning)
45 return (Container *) this;
48 return new ContainerTest;
51 void ContainerTest::checkCapabilityToDealWith(const ComponentInstance *inst) const throw(Exception)
53 if(inst->getKind()!=SUPPORTED_COMP_KIND)
54 throw Exception("ContainerTest not compatible with this type of instance.");
57 void ContainerTest::initAllContainers()
62 ContainerTest2::ContainerTest2():_alreadyStarted(false),_myCounter(_counter++)
66 bool ContainerTest2::isAlreadyStarted() const
68 return _alreadyStarted;
71 void ContainerTest2::start() throw(Exception)
74 throw Exception("ContainerTest already started !!!!");
78 Container *ContainerTest2::clone() const
80 if(_isAttachedOnCloning)
83 return (Container *) this;
86 return new ContainerTest2;
89 void ContainerTest2::initAllContainers()
94 void ContainerTest2::checkCapabilityToDealWith(const ComponentInstance *inst) const throw(Exception)
96 if(inst->getKind()!=SUPPORTED_COMP_KIND)
97 throw Exception("ContainerTest not compatible with this type of instance.");