Version: 9.16.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) override
 Start a salome container (true salome container not yacs one) with given ContainerParameters (_params) More...
 
void start (const Task *askingNode, const std::string &resource_name, const std::string &container_name) override
 
bool canAcceptImposedResource () override
 
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
 
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)
 
virtual CORBA::Object_ptr loadComponent (Task *inst)
 Load a component instance in this container. More...
 
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 std::string getKind () const =0
 
virtual std::string getDiscreminantStrOfThis (const Task *askingNode) const
 
virtual bool isAlreadyStarted (const Task *askingNode) const =0
 
virtual void start (const Task *askingNode)=0
 
virtual void start (const Task *askingNode, const std::string &resource_name, const std::string &container_name)
 
virtual bool canAcceptImposedResource ()
 
virtual bool isUsingPythonCache ()
 
virtual void usePythonCache (bool v)
 
virtual std::string getPlacementId (const Task *askingNode) const =0
 
virtual std::string getFullPlacementId (const Task *askingNode) const =0
 
virtual void setAttachOnCloningStatus (bool val) const
 
virtual void attachOnCloning () const
 
virtual void dettachOnCloning () const
 
virtual bool isAttachedOnCloning () const
 
virtual void lock ()=0
 
virtual void unLock ()=0
 
virtual Containerclone () const =0
 WARNING ! clone behaviour MUST be in coherence with what is returned by isAttachedOnCloning() method More...
 
virtual ContainercloneAlways () const =0
 
virtual bool isSupportingRTODefNbOfComp () const
 
virtual void checkCapabilityToDealWith (const ComponentInstance *inst) const =0
 
virtual void setProperty (const std::string &name, const std::string &value)=0
 
virtual std::string getProperty (const std::string &name) const =0
 
virtual void clearProperties ()=0
 
virtual void addComponentName (const std::string &name)=0
 
virtual std::map< std::string, std::string > getProperties () const =0
 
virtual std::map< std::string, std::string > getResourceProperties (const std::string &name) const =0
 
virtual void setProperties (const std::map< std::string, std::string > &properties)
 
virtual 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 ()
 
virtual void shutdown (int level)=0
 
- Public Member Functions inherited from YACS::ENGINE::RefCounter
unsigned int getRefCnt () const
 
void incrRef () const
 
bool decrRef () const
 

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"
 
- Static Public Attributes inherited from YACS::ENGINE::Container
static const char KIND_ENTRY [] ="container_kind"
 
static const char AOC_ENTRY [] ="attached_on_cloning"
 
static const char USE_PYCACHE_PROPERTY [] ="use_py_cache"
 
- Static Public Attributes inherited from YACS::ENGINE::RefCounter
static unsigned int _totalCnt =0
 
- Protected Member Functions inherited from YACS::ENGINE::SalomeContainer
virtual ~SalomeContainer ()
 
- Protected Member Functions inherited from YACS::ENGINE::Container
 Container ()
 
virtual ~Container ()
 
- Protected Member Functions inherited from YACS::ENGINE::RefCounter
 RefCounter ()
 
 RefCounter (const RefCounter &other)
 
virtual ~RefCounter ()
 
- 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
 
- Protected Attributes inherited from YACS::ENGINE::Container
std::string _name
 
bool _isAttachedOnCloning
 
Proc_proc
 
- Protected Attributes inherited from YACS::ENGINE::RefCounter
unsigned int _cnt
 

Detailed Description

Definition at line 33 of file SalomeContainerTmpForHP.hxx.

Constructor & Destructor Documentation

◆ SalomeContainerTmpForHP()

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.

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

Referenced by BuildFrom().

Member Function Documentation

◆ BuildFrom()

SalomeContainerTmpForHP * SalomeContainerTmpForHP::BuildFrom ( const SalomeHPContainer cont,
const Task askingNode 
)
static

Definition at line 56 of file SalomeContainerTmpForHP.cxx.

57{
58 const SalomeContainerHelper *lmt(0);
59 std::size_t posIn(0);
60 {
62 lmt=cont->getHelperOfTask(askingNode);
63 posIn=cont->locateTask(askingNode);
64 }
65 return new SalomeContainerTmpForHP(*cont,cont->getContainerInfo(),lmt,cont->getComponentNames(),cont->getShutdownLev(),cont,posIn);
66}
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)
SalomeContainerMonoHelper * getHelperOfTask(const Task *node)
std::vector< std::string > getComponentNames() const
const SalomeContainerTools & getContainerInfo() const
std::size_t locateTask(const Task *askingNode) const

References YACS::ENGINE::SalomeHPContainer::getComponentNames(), YACS::ENGINE::SalomeHPContainer::getContainerInfo(), YACS::ENGINE::SalomeHPContainer::getHelperOfTask(), YACS::ENGINE::SalomeHPContainer::getShutdownLev(), YACS::ENGINE::SalomeHPContainer::locateTask(), and SalomeContainerTmpForHP().

Referenced by GetContainerObj(), YACS::ENGINE::SalomeHPContainer::getDiscreminantStrOfThis(), YACS::ENGINE::DistributedPythonNode::load(), and YACS::ENGINE::SalomeHPComponent::load().

◆ getDiscreminantStrOfThis()

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

Reimplemented from YACS::ENGINE::Container.

Definition at line 39 of file SalomeContainerTmpForHP.hxx.

39{ std::ostringstream oss; oss << _zeOriginCont << "_" << _pos; return oss.str(); }

References _pos, and _zeOriginCont.

◆ loadComponent()

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.

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());
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}
Base class for all component instances.
virtual Engines::Container_var getContainer(const Task *askingNode) const =0
static CORBA::Object_ptr CreateComponentInstance(Container *cont, Engines::Container_ptr contPtr, const ComponentInstance *inst)
bool isAlreadyStarted(const Task *askingNode) const
Check if the component instance container is already started.
void start(const Task *askingNode) override
Start a salome container (true salome container not yacs one) with given ContainerParameters (_params...
SalomeContainerHelper * _launchModeType
virtual ComponentInstance * getComponent()=0

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

Member Data Documentation

◆ _pos

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

Definition at line 44 of file SalomeContainerTmpForHP.hxx.

Referenced by getDiscreminantStrOfThis().

◆ _zeOriginCont

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: