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
20 #include "ComponentInstanceTest.hxx"
21 #include "ToyNode.hxx"
24 using namespace YACS::ENGINE;
26 ComponentInstanceTest1::ComponentInstanceTest1(const ComponentInstanceTest1& other):ComponentInstance(other),_loaded(false)
30 ComponentInstanceTest1::ComponentInstanceTest1(const std::string& name):ComponentInstance(name),_loaded(false)
34 void ComponentInstanceTest1::load()
39 void ComponentInstanceTest1::unload()
44 bool ComponentInstanceTest1::isLoaded()
49 std::string ComponentInstanceTest1::getKind() const
51 return ToyNode1S::KIND;
54 ServiceNode* ComponentInstanceTest1::createNode(const std::string& name)
56 ToyNode1S* node=new ToyNode1S(name);
57 node->setComponent(this);
61 ComponentInstance *ComponentInstanceTest1::clone() const
63 if(isAttachedOnCloning())
66 return (ComponentInstance *) this;
69 return new ComponentInstanceTest1(*this);
72 ComponentInstanceTest2::ComponentInstanceTest2(const ComponentInstanceTest2& other):ComponentInstance(other),_loaded(false)
76 ComponentInstanceTest2::ComponentInstanceTest2(const std::string& name):ComponentInstance(name),_loaded(false)
80 void ComponentInstanceTest2::load()
85 void ComponentInstanceTest2::unload()
90 bool ComponentInstanceTest2::isLoaded()
95 std::string ComponentInstanceTest2::getKind() const
97 return ToyNode2S::KIND;
100 ServiceNode* ComponentInstanceTest2::createNode(const std::string& name)
102 ToyNode2S* node=new ToyNode2S(name);
103 node->setComponent(this);
107 ComponentInstance *ComponentInstanceTest2::clone() const
109 if(isAttachedOnCloning())
112 return (ComponentInstance *) this;
115 return new ComponentInstanceTest2(*this);