1 #include "ComponentInstance.hxx"
2 #include "Container.hxx"
7 #include "YacsTrace.hxx"
9 using namespace YACS::ENGINE;
12 const char ComponentInstance::KIND[]="";
14 const char ComponentInstance::NULL_FILE_REPR[]="No repr specified for ComponentInstance";
16 void ComponentInstance::setContainer(Container *cont)
18 if (cont == _container) return;
21 cont->checkCapabilityToDealWith(this);
23 _container->decrRef();
26 _container->incrRef();
29 ComponentInstance::ComponentInstance(const std::string& name):_name(name),_isAttachedOnCloning(false),_container(0)
33 ComponentInstance::ComponentInstance(const ComponentInstance& other):_name(other._name),
35 _isAttachedOnCloning(other._isAttachedOnCloning)
38 _container=other._container->clone();
41 ComponentInstance::~ComponentInstance()
44 _container->decrRef();
48 * By calling this method the current container 'this' is not destined to be deeply copied on clone call.
50 void ComponentInstance::attachOnCloning() const
52 _isAttachedOnCloning=true;
55 std::string ComponentInstance::getFileRepr() const
57 return NULL_FILE_REPR;
61 * By calling this method the current container 'this' will be deeply copied on clone call.
63 void ComponentInstance::dettachOnCloning() const
65 _isAttachedOnCloning=false;
68 bool ComponentInstance::isAttachedOnCloning() const
70 return _isAttachedOnCloning;
73 string ComponentInstance::getKind() const