Version: 8.3.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 ()
 

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 ()
 
- 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::SalomeHPComponent ( const std::string &  name)

Definition at line 45 of file SalomeHPComponent.cxx.

References _objComponent.

Referenced by clone(), and cloneAlways().

45  : ComponentInstance(name)
46 {
47  _objComponent=CORBA::Object::_nil();
48 }
SalomeHPComponent::SalomeHPComponent ( const SalomeHPComponent other)

Definition at line 50 of file SalomeHPComponent.cxx.

References _objComponent.

50  :ComponentInstance(other)
51 {
52  _objComponent=CORBA::Object::_nil();
53 }
SalomeHPComponent::~SalomeHPComponent ( )
virtual

Definition at line 55 of file SalomeHPComponent.cxx.

56 {
57 }

Member Function Documentation

ComponentInstance * SalomeHPComponent::clone ( ) const
virtual

Clone the component instance.

Implements YACS::ENGINE::ComponentInstance.

Definition at line 120 of file SalomeHPComponent.cxx.

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

121 {
123  {
124  incrRef();
125  return (ComponentInstance*) (this);
126  }
127  else
128  return new SalomeHPComponent(*this);
129 }
ComponentInstance * SalomeHPComponent::cloneAlways ( ) const
virtual

Implements YACS::ENGINE::ComponentInstance.

Definition at line 131 of file SalomeHPComponent.cxx.

References SalomeHPComponent().

132 {
133  return new SalomeHPComponent(*this);
134 }
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 112 of file SalomeHPComponent.cxx.

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

113 {
114  SalomeNode* node(new SalomeNode(name));
115  node->setComponent(this);
116  return node;
117 }
virtual CORBA::Object_ptr YACS::ENGINE::SalomeHPComponent::getCompoPtr ( )
inlinevirtual

Definition at line 45 of file SalomeHPComponent.hxx.

45 {return CORBA::Object::_duplicate(_objComponent);}
std::string SalomeHPComponent::getFileRepr ( ) const
virtual

For dump in file.

Reimplemented from YACS::ENGINE::ComponentInstance.

Definition at line 136 of file SalomeHPComponent.cxx.

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

137 {
138  ostringstream stream;
139  stream << "<component>" << getCompoName() << "</component>";
140  return stream.str();
141 }
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 59 of file SalomeHPComponent.cxx.

References KIND.

60 {
61  return KIND;
62 }
std::string SalomeHPComponent::getKindForNode ( ) const
virtual

Reimplemented from YACS::ENGINE::ComponentInstance.

Definition at line 64 of file SalomeHPComponent.cxx.

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

65 {
66  return SalomeComponent::KIND;
67 }
bool SalomeHPComponent::isLoaded ( Task askingNode) const
virtual

Is the component instance already loaded ?

Implements YACS::ENGINE::ComponentInstance.

Definition at line 77 of file SalomeHPComponent.cxx.

78 {
79  return false;
80 }
void SalomeHPComponent::load ( Task askingNode)
virtual

Load the component.

Implements YACS::ENGINE::ComponentInstance.

Definition at line 84 of file SalomeHPComponent.cxx.

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

85 {
86  if(_container)
87  {
88  SalomeHPContainer *salomeContainer(dynamic_cast<SalomeHPContainer *>(_container));
89  if(salomeContainer)
90  {
92  _objComponent=tmpCont->loadComponent(askingNode);
93  return ;
94  }
95  throw Exception("Unrecognized type of Container ! Only Salome and HPSalome container are supported by the Salome components !");
96  }
97  else
98  throw Exception("No container on HP component ! Impossible to load !");
99 }
bool SalomeHPComponent::setContainer ( Container cont)
virtual

Reimplemented from YACS::ENGINE::ComponentInstance.

Definition at line 143 of file SalomeHPComponent.cxx.

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

144 {
145  if(!dynamic_cast<SalomeHPContainer *>(cont))
146  throw Exception("SalomeHPComponent::setContainer : a Salome HP component must be attached to a Salome HP container !");
148  {
149  if(_container)
151  return true;
152  }
153  else
154  return false;
155 }
void SalomeHPComponent::shutdown ( int  level)
virtual

Reimplemented from YACS::ENGINE::ComponentInstance.

Definition at line 157 of file SalomeHPComponent.cxx.

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

158 {
159  DEBTRACE("SalomeHPComponent::shutdown " << level);
160  if(_container)
161  _container->shutdown(level);
162 }
void SalomeHPComponent::unload ( Task askingNode)
virtual

Unload the component.

Implements YACS::ENGINE::ComponentInstance.

Definition at line 70 of file SalomeHPComponent.cxx.

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

Member Data Documentation

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

Definition at line 52 of file SalomeHPComponent.hxx.

Referenced by load(), and SalomeHPComponent().

const char SalomeHPComponent::KIND ="HPSalome"
static

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