2 #include "SalomePythonComponent.hxx"
3 #include "SalomeComponent.hxx"
4 #include "SalomePythonNode.hxx"
5 #include "Exception.hxx"
6 #include "Container.hxx"
10 using namespace YACS::ENGINE;
12 const char SalomePythonComponent::KIND[]="SalomePy";
14 unsigned SalomePythonComponent::_cntForReprS = 0;
16 SalomePythonComponent::SalomePythonComponent(const std::string &name):ComponentInstance(name),_cntForRepr(_cntForReprS++)
20 SalomePythonComponent::SalomePythonComponent(const SalomePythonComponent& other):ComponentInstance(other),_cntForRepr(_cntForReprS++)
24 SalomePythonComponent::~SalomePythonComponent()
28 void SalomePythonComponent::load()
35 //This component has no specified container : use default container policy
36 //given by getStringValueToExportInInterp()
37 //throw Exception("SalomePythonComponent::load : no container specified !!! To be implemented in executor to allocate default a Container in case of presenceOfDefaultContainer.");
40 void SalomePythonComponent::unload()
44 bool SalomePythonComponent::isLoaded()
49 return _container->isAlreadyStarted();
52 std::string SalomePythonComponent::getKind() const
54 //This is not a bug !!!! SalomeComponent NOT SalomePythonComponent. This is for Container assignation.
55 return SalomeComponent::KIND;
58 ComponentInstance* SalomePythonComponent::clone() const
60 if(_isAttachedOnCloning)
63 return (ComponentInstance*) (this);
66 return new SalomePythonComponent(*this);
69 ServiceNode *SalomePythonComponent::createNode(const std::string &name)
71 ServiceNode* node=new SalomePythonNode(name);
72 node->setComponent(this);
76 std::string SalomePythonComponent::getFileRepr() const
78 std::ostringstream stream;
79 stream << "<ref>" << "SalomePythonComponent #" << _cntForRepr << "</ref>";
83 std::string SalomePythonComponent::getStringValueToExportInInterp() const
86 return "localhost/FactoryServer";
88 return _container->getPlacementId();