Version: 9.15.0
YACS::ENGINE::SalomeHPComponent Class Reference

#include <SalomeHPComponent.hxx>

Inheritance diagram for YACS::ENGINE::SalomeHPComponent:
Collaboration diagram for YACS::ENGINE::SalomeHPComponent:

Public Member Functions

 SalomeHPComponent (const std::string &name)
 
 SalomeHPComponent (const SalomeHPComponent &other)
 
virtual ~SalomeHPComponent ()
 
virtual void load (Task *askingNode)
 Load the component. More...
 
virtual void unload (Task *askingNode)
 Unload the component. More...
 
virtual bool isLoaded (Task *askingNode) const
 Is the component instance already loaded ? More...
 
virtual bool setContainer (Container *cont)
 
virtual ServiceNodecreateNode (const std::string &name)
 Create a ServiceNode with this component instance and no input or output port. More...
 
virtual ComponentInstanceclone () const
 Clone the component instance. More...
 
virtual ComponentInstancecloneAlways () const
 
virtual std::string getFileRepr () const
 For dump in file. More...
 
virtual CORBA::Object_ptr getCompoPtr ()
 
virtual void shutdown (int level)
 
virtual std::string getKind () const
 Return the component kind. More...
 
virtual std::string getKindForNode () const
 
- 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
 
ContainergetContainer () const
 
virtual void attachOnCloning () const
 
virtual void dettachOnCloning () const
 
bool isAttachedOnCloning () const
 
- 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 () const
 

Static Public Attributes

static const char KIND [] ="HPSalome"
 
- 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
 

Protected Attributes

CORBA::Object_var _objComponent
 
- 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
 
- Protected Attributes inherited from YACS::ENGINE::PropertyInterface
std::map< std::string, std::string > _propertyMap
 
- Protected Attributes inherited from YACS::ENGINE::RefCounter
unsigned int _cnt
 

Additional Inherited Members

- Protected Member Functions inherited from YACS::ENGINE::ComponentInstance
virtual ~ComponentInstance ()
 
- Protected Member Functions inherited from YACS::ENGINE::RefCounter
 RefCounter ()
 
 RefCounter (const RefCounter &other)
 
virtual ~RefCounter ()
 
- 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 31 of file SalomeHPComponent.hxx.

Constructor & Destructor Documentation

◆ SalomeHPComponent() [1/2]

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

Definition at line 44 of file SalomeHPComponent.cxx.

44  : ComponentInstance(name)
45 {
46  _objComponent=CORBA::Object::_nil();
47 }
ComponentInstance(const std::string &name)

References _objComponent.

Referenced by clone(), and cloneAlways().

◆ SalomeHPComponent() [2/2]

SalomeHPComponent::SalomeHPComponent ( const SalomeHPComponent other)

Definition at line 49 of file SalomeHPComponent.cxx.

49  :ComponentInstance(other)
50 {
51  _objComponent=CORBA::Object::_nil();
52 }

References _objComponent.

◆ ~SalomeHPComponent()

SalomeHPComponent::~SalomeHPComponent ( )
virtual

Definition at line 54 of file SalomeHPComponent.cxx.

55 {
56 }

Member Function Documentation

◆ clone()

ComponentInstance * SalomeHPComponent::clone ( ) const
virtual

Clone the component instance.

Implements YACS::ENGINE::ComponentInstance.

Definition at line 119 of file SalomeHPComponent.cxx.

120 {
122  {
123  incrRef();
124  return (ComponentInstance*) (this);
125  }
126  else
127  return new SalomeHPComponent(*this);
128 }
Base class for all component instances.
SalomeHPComponent(const std::string &name)

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

◆ cloneAlways()

ComponentInstance * SalomeHPComponent::cloneAlways ( ) const
virtual

Implements YACS::ENGINE::ComponentInstance.

Definition at line 130 of file SalomeHPComponent.cxx.

131 {
132  return new SalomeHPComponent(*this);
133 }

References SalomeHPComponent().

◆ createNode()

ServiceNode * SalomeHPComponent::createNode ( const std::string &  name)
virtual

Create a ServiceNode with this component instance and no input or output port.

Parameters
name: node name
Returns
a new SalomeNode node

Implements YACS::ENGINE::ComponentInstance.

Definition at line 111 of file SalomeHPComponent.cxx.

112 {
113  SalomeNode* node(new SalomeNode(name));
114  node->setComponent(this);
115  return node;
116 }
Class for Salome component Service Node.
Definition: CORBANode.hxx:68

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

◆ getCompoPtr()

virtual CORBA::Object_ptr YACS::ENGINE::SalomeHPComponent::getCompoPtr ( )
inlinevirtual

Definition at line 45 of file SalomeHPComponent.hxx.

45 {return CORBA::Object::_duplicate(_objComponent);}

◆ getFileRepr()

std::string SalomeHPComponent::getFileRepr ( ) const
virtual

For dump in file.

Reimplemented from YACS::ENGINE::ComponentInstance.

Definition at line 135 of file SalomeHPComponent.cxx.

136 {
137  ostringstream stream;
138  stream << "<component>" << getCompoName() << "</component>";
139  return stream.str();
140 }
const std::string & getCompoName() const

References YACS::ENGINE::ComponentInstance::getCompoName().

◆ getKind()

std::string SalomeHPComponent::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 58 of file SalomeHPComponent.cxx.

59 {
60  return KIND;
61 }

References KIND.

◆ getKindForNode()

std::string SalomeHPComponent::getKindForNode ( ) const
virtual

Reimplemented from YACS::ENGINE::ComponentInstance.

Definition at line 63 of file SalomeHPComponent.cxx.

64 {
65  return SalomeComponent::KIND;
66 }

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

◆ isLoaded()

bool SalomeHPComponent::isLoaded ( Task askingNode) const
virtual

Is the component instance already loaded ?

Implements YACS::ENGINE::ComponentInstance.

Definition at line 76 of file SalomeHPComponent.cxx.

77 {
78  return false;
79 }

◆ load()

void SalomeHPComponent::load ( Task askingNode)
virtual

Load the component.

Implements YACS::ENGINE::ComponentInstance.

Definition at line 83 of file SalomeHPComponent.cxx.

84 {
85  if(_container)
86  {
87  SalomeHPContainer *salomeContainer(dynamic_cast<SalomeHPContainer *>(_container));
88  if(salomeContainer)
89  {
91  _objComponent=tmpCont->loadComponent(askingNode);
92  return ;
93  }
94  throw Exception("Unrecognized type of Container ! Only Salome and HPSalome container are supported by the Salome components !");
95  }
96  else
97  throw Exception("No container on HP component ! Impossible to load !");
98 }
static SalomeContainerTmpForHP * BuildFrom(const SalomeHPContainer *cont, const Task *askingNode)

References YACS::ENGINE::ComponentInstance::_container, _objComponent, and YACS::ENGINE::SalomeContainerTmpForHP::BuildFrom().

◆ setContainer()

bool SalomeHPComponent::setContainer ( Container cont)
virtual

Reimplemented from YACS::ENGINE::ComponentInstance.

Definition at line 142 of file SalomeHPComponent.cxx.

143 {
144  if(!dynamic_cast<SalomeHPContainer *>(cont))
145  throw Exception("SalomeHPComponent::setContainer : a Salome HP component must be attached to a Salome HP container !");
147  {
148  if(_container)
150  return true;
151  }
152  else
153  return false;
154 }
virtual bool setContainer(Container *cont)
std::string _compoName
WARNING : _compoName identify only the component type.
virtual void addComponentName(const std::string &name)=0

References YACS::ENGINE::ComponentInstance::_compoName, YACS::ENGINE::ComponentInstance::_container, YACS::ENGINE::Container::addComponentName(), and YACS::ENGINE::ComponentInstance::setContainer().

◆ shutdown()

void SalomeHPComponent::shutdown ( int  level)
virtual

Reimplemented from YACS::ENGINE::ComponentInstance.

Definition at line 156 of file SalomeHPComponent.cxx.

157 {
158  DEBTRACE("SalomeHPComponent::shutdown " << level);
159  if(_container)
160  _container->shutdown(level);
161 }
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
virtual void shutdown(int level)=0

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

◆ unload()

void SalomeHPComponent::unload ( Task askingNode)
virtual

Unload the component.

Implements YACS::ENGINE::ComponentInstance.

Definition at line 69 of file SalomeHPComponent.cxx.

70 {
71  //Not implemented
72  std::cerr << "SalomeHPComponent::unload : not implemented " << std::endl;
73 }

Member Data Documentation

◆ _objComponent

CORBA::Object_var YACS::ENGINE::SalomeHPComponent::_objComponent
protected

Definition at line 52 of file SalomeHPComponent.hxx.

Referenced by load(), and SalomeHPComponent().

◆ KIND

const char SalomeHPComponent::KIND ="HPSalome"
static

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