Version: 8.3.0
YACS::ENGINE::SalomeContainerTmpForHP Class Reference

#include <SalomeContainerTmpForHP.hxx>

Inheritance diagram for YACS::ENGINE::SalomeContainerTmpForHP:
Collaboration diagram for YACS::ENGINE::SalomeContainerTmpForHP:

Public Member Functions

 SalomeContainerTmpForHP (const Container &other, const SalomeContainerTools &sct, const SalomeContainerHelper *lmt, const std::vector< std::string > &componentNames, int shutdownLev, const SalomeHPContainer *zeOriginCont, std::size_t pos)
 
std::string getDiscreminantStrOfThis (const Task *askingNode) const
 
CORBA::Object_ptr loadComponent (Task *inst)
 Load a component instance in this container. More...
 
- Public Member Functions inherited from YACS::ENGINE::SalomeContainer
 SalomeContainer ()
 
 SalomeContainer (const SalomeContainer &other)
 
 SalomeContainer (const Container &other, const SalomeContainerTools &sct, const SalomeContainerHelper *lmt, const std::vector< std::string > &componentNames, int shutdownLev)
 
void lock ()
 For thread safety for concurrent load operation on same Container. More...
 
void unLock ()
 For thread safety for concurrent load operation on same Container. More...
 
std::string getKind () const
 
bool isAlreadyStarted (const Task *askingNode) const
 Check if the component instance container is already started. More...
 
Engines::Container_ptr getContainerPtr (const Task *askingNode) const
 
void start (const Task *askingNode) throw (Exception)
 Start a salome container (true salome container not yacs one) with given ContainerParameters (_params) More...
 
Containerclone () const
 WARNING ! clone behaviour MUST be in coherence with what is returned by isAttachedOnCloning() method More...
 
ContainercloneAlways () const
 
std::string getPlacementId (const Task *askingNode) const
 Get the container placement id for a component instance. More...
 
std::string getFullPlacementId (const Task *askingNode) const
 Get the container full path for a component instance. More...
 
void checkCapabilityToDealWith (const ComponentInstance *inst) const throw (Exception)
 
void setProperty (const std::string &name, const std::string &value)
 
std::string getProperty (const std::string &name) const
 
void clearProperties ()
 
void addComponentName (const std::string &name)
 
void addToResourceList (const std::string &name)
 
void shutdown (int level)
 
std::map< std::string,
std::string > 
getResourceProperties (const std::string &name) const
 
std::map< std::string,
std::string > 
getProperties () const
 
- Public Member Functions inherited from YACS::ENGINE::Container
virtual void setAttachOnCloningStatus (bool val) const
 
virtual void attachOnCloning () const
 
virtual void dettachOnCloning () const
 
virtual bool isAttachedOnCloning () const
 
virtual bool isSupportingRTODefNbOfComp () const
 
virtual void setProperties (const std::map< std::string, std::string > &properties)
 
std::string getName () const
 
void setName (std::string name)
 WARNING ! name is used in edition to identify different containers, it is not the runtime name of the container More...
 
void setProc (Proc *proc)
 
ProcgetProc ()
 
- Public Member Functions inherited from YACS::ENGINE::RefCounter
unsigned int getRefCnt () const
 
void incrRef () const
 
bool decrRef ()
 

Static Public Member Functions

static SalomeContainerTmpForHPBuildFrom (const SalomeHPContainer *cont, const Task *askingNode)
 

Private Attributes

const SalomeHPContainer_zeOriginCont
 
std::size_t _pos
 

Additional Inherited Members

- Static Public Attributes inherited from YACS::ENGINE::SalomeContainer
static const char KIND [] ="Salome"
 
static const char TYPE_PROPERTY_STR [] ="type"
 
- Protected Member Functions inherited from YACS::ENGINE::SalomeContainer
virtual ~SalomeContainer ()
 
- Protected Attributes inherited from YACS::ENGINE::SalomeContainer
YACS::BASES::Mutex _mutex
 thread safety in Salome ??? More...
 
std::vector< std::string > _componentNames
 
SalomeContainerHelper_launchModeType
 
int _shutdownLevel
 
SalomeContainerTools _sct
 

Detailed Description

Definition at line 33 of file SalomeContainerTmpForHP.hxx.

Constructor & Destructor Documentation

YACS::ENGINE::SalomeContainerTmpForHP::SalomeContainerTmpForHP ( const Container other,
const SalomeContainerTools sct,
const SalomeContainerHelper lmt,
const std::vector< std::string > &  componentNames,
int  shutdownLev,
const SalomeHPContainer zeOriginCont,
std::size_t  pos 
)
inline

Definition at line 36 of file SalomeContainerTmpForHP.hxx.

Referenced by BuildFrom().

38  :SalomeContainer(other,sct,lmt,componentNames,shutdownLev),_zeOriginCont(zeOriginCont),_pos(pos) { }

Member Function Documentation

std::string YACS::ENGINE::SalomeContainerTmpForHP::getDiscreminantStrOfThis ( const Task askingNode) const
inlinevirtual

Reimplemented from YACS::ENGINE::Container.

Definition at line 39 of file SalomeContainerTmpForHP.hxx.

References _pos, and _zeOriginCont.

Referenced by YACS::ENGINE::SalomeHPContainer::getDiscreminantStrOfThis().

39 { std::ostringstream oss; oss << _zeOriginCont << "_" << _pos; return oss.str(); }
CORBA::Object_ptr SalomeContainerTmpForHP::loadComponent ( Task askingNode)
virtual

Load a component instance in this container.

Parameters
instthe component instance to load

Reimplemented from YACS::ENGINE::SalomeContainer.

Definition at line 28 of file SalomeContainerTmpForHP.cxx.

References YACS::ENGINE::SalomeContainer::_launchModeType, YACS::ENGINE::SalomeContainerTools::CreateComponentInstance(), YACS::ENGINE::Task::getComponent(), YACS::ENGINE::SalomeContainerHelper::getContainer(), YACS::ENGINE::SalomeContainer::isAlreadyStarted(), and YACS::ENGINE::SalomeContainer::start().

Referenced by YACS::ENGINE::SalomeHPComponent::load().

29 {
30  const ComponentInstance *inst(askingNode?askingNode->getComponent():0);
31  if(!inst)
32  throw Exception("SalomeContainerTmpForHP::loadComponent : asking to load a component on the given task whereas this task has no component !");
33  std::string compoName(inst->getCompoName());
34  {
35  YACS::BASES::AutoLocker<Container> alck(this);//To be sure
36  if(!this->isAlreadyStarted(askingNode))
37  this->start(askingNode);
38  }
39  CORBA::Object_ptr objComponent=CORBA::Object::_nil();
40  {
41  YACS::BASES::AutoLocker<Container> alck(this);//To be sure
42  std::string compoName(inst->getCompoName());
43  Engines::Container_var container(_launchModeType->getContainer(askingNode));
44  objComponent=container->find_component_instance(compoName.c_str(),0);
45  if(CORBA::is_nil(objComponent))
46  {
47  char *reason;
48  bool isLoadable(container->load_component_Library(compoName.c_str(), reason));
49  if(isLoadable)
50  objComponent=SalomeContainerTools::CreateComponentInstance(this,container,inst);
51  }
52  }
53  return objComponent;
54 }

Member Data Documentation

std::size_t YACS::ENGINE::SalomeContainerTmpForHP::_pos
private

Definition at line 44 of file SalomeContainerTmpForHP.hxx.

Referenced by getDiscreminantStrOfThis().

const SalomeHPContainer* YACS::ENGINE::SalomeContainerTmpForHP::_zeOriginCont
private

Definition at line 43 of file SalomeContainerTmpForHP.hxx.

Referenced by getDiscreminantStrOfThis().


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