Version: 8.3.0
YACS::ENGINE::SalomePythonComponent Class Reference

#include <SalomePythonComponent.hxx>

Inheritance diagram for YACS::ENGINE::SalomePythonComponent:
Collaboration diagram for YACS::ENGINE::SalomePythonComponent:

Public Member Functions

 SalomePythonComponent (const std::string &name)
 
 SalomePythonComponent (const SalomePythonComponent &other)
 
std::string getPlacementId () const
 
virtual ~SalomePythonComponent ()
 
virtual void load (Task *askingNode)
 Load the component instance. More...
 
virtual void unload (Task *askingNode)
 Unload the component instance. More...
 
virtual bool isLoaded (Task *askingNode) const
 Indicate if the component instance is loaded (true) or not. More...
 
virtual std::string getKind () const
 Return the component kind. More...
 
virtual ComponentInstanceclone () const
 
virtual ComponentInstancecloneAlways () const
 
virtual std::string getFileRepr () const
 For dump in file. More...
 
virtual ServiceNodecreateNode (const std::string &name)
 
std::string getStringValueToExportInInterp (const Task *askingNode) const
 The specific method that justified SalomePythonComponent class. More...
 
- Public Member Functions inherited from YACS::ENGINE::ComponentInstance
 ComponentInstance (const std::string &name)
 
 ComponentInstance (const ComponentInstance &other)
 
const std::string & getCompoName () const
 
const std::string & getInstanceName () const
 
void setName (const std::string &name)
 
virtual void setAnonymous (bool anon)
 
virtual bool isAnonymous ()
 
int getNumId () const
 
virtual bool setContainer (Container *cont)
 
ContainergetContainer () const
 
virtual void attachOnCloning () const
 
virtual void dettachOnCloning () const
 
bool isAttachedOnCloning () const
 
virtual std::string getKindForNode () const
 
virtual void shutdown (int level)
 
- Public Member Functions inherited from YACS::ENGINE::PropertyInterface
virtual ~PropertyInterface ()
 
virtual void setProperty (const std::string &name, const std::string &value)
 
virtual std::string getProperty (const std::string &name)
 Get a property value given its name. More...
 
std::map< std::string,
std::string > 
getProperties () const
 
virtual void setProperties (std::map< std::string, std::string > properties)
 
- Public Member Functions inherited from YACS::ENGINE::RefCounter
unsigned int getRefCnt () const
 
void incrRef () const
 
bool decrRef ()
 

Public Attributes

unsigned _cntForRepr
 

Static Public Attributes

static unsigned _cntForReprS = 0
 
static const char KIND [] ="SalomePy"
 
- Static Public Attributes inherited from YACS::ENGINE::ComponentInstance
static const char KIND [] =""
 
- Static Public Attributes inherited from YACS::ENGINE::RefCounter
static unsigned int _totalCnt =0
 

Additional Inherited Members

- Protected Member Functions inherited from YACS::ENGINE::ComponentInstance
virtual ~ComponentInstance ()
 
- Protected Attributes inherited from YACS::ENGINE::ComponentInstance
std::string _compoName
 WARNING : _compoName identify only the component type. More...
 
std::string _instanceName
 WARNING : _InstanceName has a strong semantic. It discriminates ComponentInstance instances each other. More...
 
int _numId
 
Container_container
 
bool _isAttachedOnCloning
 
bool _anonymous
 
- Static Protected Attributes inherited from YACS::ENGINE::ComponentInstance
static const char NULL_FILE_REPR [] ="No repr specified for ComponentInstance"
 
static int _total = 0
 

Detailed Description

Definition at line 29 of file SalomePythonComponent.hxx.

Constructor & Destructor Documentation

SalomePythonComponent::SalomePythonComponent ( const std::string &  name)

Definition at line 35 of file SalomePythonComponent.cxx.

Referenced by clone(), and cloneAlways().

36 {
37 }
SalomePythonComponent::SalomePythonComponent ( const SalomePythonComponent other)

Definition at line 39 of file SalomePythonComponent.cxx.

40 {
41 }
SalomePythonComponent::~SalomePythonComponent ( )
virtual

Definition at line 43 of file SalomePythonComponent.cxx.

44 {
45 }

Member Function Documentation

ComponentInstance * SalomePythonComponent::clone ( ) const
virtual

Implements YACS::ENGINE::ComponentInstance.

Definition at line 77 of file SalomePythonComponent.cxx.

References YACS::ENGINE::ComponentInstance::_isAttachedOnCloning, YACS::ENGINE::RefCounter::incrRef(), and SalomePythonComponent().

78 {
80  {
81  incrRef();
82  return (ComponentInstance*) (this);
83  }
84  else
85  return new SalomePythonComponent(*this);
86 }
ComponentInstance * SalomePythonComponent::cloneAlways ( ) const
virtual

Implements YACS::ENGINE::ComponentInstance.

Definition at line 88 of file SalomePythonComponent.cxx.

References SalomePythonComponent().

89 {
90  return new SalomePythonComponent(*this);
91 }
ServiceNode * SalomePythonComponent::createNode ( const std::string &  name)
virtual

Implements YACS::ENGINE::ComponentInstance.

Definition at line 93 of file SalomePythonComponent.cxx.

References YACS::ENGINE::ServiceNode::setComponent().

94 {
95  ServiceNode* node=new SalomePythonNode(name);
96  node->setComponent(this);
97  return node;
98 }
std::string SalomePythonComponent::getFileRepr ( ) const
virtual

For dump in file.

Reimplemented from YACS::ENGINE::ComponentInstance.

Definition at line 100 of file SalomePythonComponent.cxx.

References _cntForRepr.

101 {
102  std::ostringstream stream;
103  stream << "<ref>" << "SalomePythonComponent #" << _cntForRepr << "</ref>";
104  return stream.str();
105 }
std::string SalomePythonComponent::getKind ( ) const
virtual

Return the component kind.

A runtime can provide several implementations of a component instance. Each implementation has a different kind. A ComponentInstance can be associated to a ServiceNode is they have the same kind.

Reimplemented from YACS::ENGINE::ComponentInstance.

Definition at line 71 of file SalomePythonComponent.cxx.

References YACS::ENGINE::SalomeComponent::KIND.

72 {
73  //This is not a bug !!!! SalomeComponent NOT SalomePythonComponent. This is for Container assignation.
74  return SalomeComponent::KIND;
75 }
std::string YACS::ENGINE::SalomePythonComponent::getPlacementId ( ) const
std::string SalomePythonComponent::getStringValueToExportInInterp ( const Task askingNode) const

The specific method that justified SalomePythonComponent class.

Definition at line 107 of file SalomePythonComponent.cxx.

References YACS::ENGINE::ComponentInstance::_container, and YACS::ENGINE::Container::getPlacementId().

108 {
109  if(!_container)
110  return "localhost/FactoryServer";
111  else
112  return _container->getPlacementId(askingNode);
113 }
bool SalomePythonComponent::isLoaded ( Task askingNode) const
virtual

Indicate if the component instance is loaded (true) or not.

Implements YACS::ENGINE::ComponentInstance.

Definition at line 63 of file SalomePythonComponent.cxx.

References YACS::ENGINE::ComponentInstance::_container, and YACS::ENGINE::Container::isAlreadyStarted().

64 {
65  if(!_container)
66  return false;
67  else
68  return _container->isAlreadyStarted(askingNode);
69 }
void SalomePythonComponent::load ( Task askingNode)
virtual

Load the component instance.

Implements YACS::ENGINE::ComponentInstance.

Definition at line 47 of file SalomePythonComponent.cxx.

References YACS::ENGINE::ComponentInstance::_container, and YACS::ENGINE::Container::start().

48 {
49  if(_container)
50  {
51  _container->start(askingNode);
52  return;
53  }
54  //This component has no specified container : use default container policy
55  //given by getStringValueToExportInInterp()
56  //throw Exception("SalomePythonComponent::load : no container specified !!! To be implemented in executor to allocate default a Container in case of presenceOfDefaultContainer.");
57 }
void SalomePythonComponent::unload ( Task askingNode)
virtual

Unload the component instance.

Implements YACS::ENGINE::ComponentInstance.

Definition at line 59 of file SalomePythonComponent.cxx.

60 {
61 }

Member Data Documentation

unsigned YACS::ENGINE::SalomePythonComponent::_cntForRepr

Definition at line 47 of file SalomePythonComponent.hxx.

Referenced by getFileRepr().

unsigned SalomePythonComponent::_cntForReprS = 0
static

Definition at line 48 of file SalomePythonComponent.hxx.

const char SalomePythonComponent::KIND ="SalomePy"
static

Definition at line 49 of file SalomePythonComponent.hxx.


The documentation for this class was generated from the following files: