Version: 9.15.0
YACS::ENGINE::Container Class Referenceabstract

#include <Container.hxx>

Inheritance diagram for YACS::ENGINE::Container:
Collaboration diagram for YACS::ENGINE::Container:

Public Member Functions

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 Attributes

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

 Container ()
 
virtual ~Container ()
 
- Protected Member Functions inherited from YACS::ENGINE::RefCounter
 RefCounter ()
 
 RefCounter (const RefCounter &other)
 
virtual ~RefCounter ()
 

Protected Attributes

std::string _name
 
bool _isAttachedOnCloning
 
Proc_proc
 
- Protected Attributes inherited from YACS::ENGINE::RefCounter
unsigned int _cnt
 

Detailed Description

This is an abstract class, that represents an abstract process in which ComponentInstances can be launched and run. An instance of this will be mapped to one and only one physical container (except in the foreach context)

Definition at line 41 of file Container.hxx.

Constructor & Destructor Documentation

◆ Container()

Container::Container ( )
protected

Definition at line 37 of file Container.cxx.

37  :_isAttachedOnCloning(false),_proc(0)
38 {
39 }

◆ ~Container()

Container::~Container ( )
protectedvirtual

Definition at line 41 of file Container.cxx.

42 {
43 }

Member Function Documentation

◆ addComponentName()

virtual void YACS::ENGINE::Container::addComponentName ( const std::string &  name)
pure virtual

◆ attachOnCloning()

void Container::attachOnCloning ( ) const
virtual

By calling this method the current container 'this' is not destined to be deeply copied on clone call.

Reimplemented in YACS::ENGINE::HomogeneousPoolContainer.

Definition at line 76 of file Container.cxx.

77 {
79 }

References _isAttachedOnCloning.

◆ canAcceptImposedResource()

bool Container::canAcceptImposedResource ( )
virtual

Reimplemented in YACS::ENGINE::SalomeContainer.

Definition at line 59 of file Container.cxx.

60 {
61  return false;
62 }

Referenced by YACS::ENGINE::PythonNode::canAcceptImposedResource(), and YACS::ENGINE::PyFuncNode::canAcceptImposedResource().

◆ checkCapabilityToDealWith()

virtual void YACS::ENGINE::Container::checkCapabilityToDealWith ( const ComponentInstance inst) const
pure virtual

◆ clearProperties()

virtual void YACS::ENGINE::Container::clearProperties ( )
pure virtual

◆ clone()

◆ cloneAlways()

virtual Container* YACS::ENGINE::Container::cloneAlways ( ) const
pure virtual

◆ dettachOnCloning()

void Container::dettachOnCloning ( ) const
virtual

By calling this method the current container 'this' will be deeply copied on clone call.

Reimplemented in YACS::ENGINE::HomogeneousPoolContainer.

Definition at line 84 of file Container.cxx.

85 {
87 }

References _isAttachedOnCloning.

◆ getDiscreminantStrOfThis()

std::string Container::getDiscreminantStrOfThis ( const Task askingNode) const
virtual

Reimplemented in YACS::ENGINE::SalomeHPContainer, and YACS::ENGINE::SalomeContainerTmpForHP.

Definition at line 45 of file Container.cxx.

46 {
47  const void *ptr(this);
48  std::ostringstream oss; oss << ptr;
49  return oss.str();
50 }

Referenced by YACS::ENGINE::SalomeContainerTools::getNotNullContainerName().

◆ getFullPlacementId()

virtual std::string YACS::ENGINE::Container::getFullPlacementId ( const Task askingNode) const
pure virtual

◆ getKind()

virtual std::string YACS::ENGINE::Container::getKind ( ) const
pure virtual

◆ getName()

◆ getPlacementId()

virtual std::string YACS::ENGINE::Container::getPlacementId ( const Task askingNode) const
pure virtual

◆ getProc()

Proc* YACS::ENGINE::Container::getProc ( )
inline

Definition at line 85 of file Container.hxx.

85 { return _proc; }

References driver_internal::_proc.

Referenced by YACS::ENGINE::SalomeContainerToolsBase::CreateComponentInstance().

◆ getProperties()

◆ getProperty()

◆ getResourceProperties()

virtual std::map<std::string,std::string> YACS::ENGINE::Container::getResourceProperties ( const std::string &  name) const
pure virtual

◆ isAlreadyStarted()

◆ isAttachedOnCloning()

◆ isSupportingRTODefNbOfComp()

bool Container::isSupportingRTODefNbOfComp ( ) const
virtual

This method informs about the capability of the container to deal with CT an unpredictably number of components. By default : True

Definition at line 98 of file Container.cxx.

99 {
100  return true;
101 }

◆ isUsingPythonCache()

bool Container::isUsingPythonCache ( )
virtual

Definition at line 109 of file Container.cxx.

110 {
111  bool found = false;
112  std::string str_value;
113  str_value = getProperty(USE_PYCACHE_PROPERTY);
114  const char* yes_values[] = {"YES", "Yes", "yes", "TRUE", "True", "true", "1",
115  "ON", "on", "On"};
116  for(const char* v : yes_values)
117  if(str_value == v)
118  {
119  found = true;
120  break;
121  }
122  return found;
123 }
virtual std::string getProperty(const std::string &name) const =0
static const char USE_PYCACHE_PROPERTY[]
Definition: Container.hxx:89

References getProperty(), and USE_PYCACHE_PROPERTY.

Referenced by FormAdvParamContainer::FillPanel(), YACS::ENGINE::PythonNode::isUsingPythonCache(), and FormAdvParamContainer::onModifyUsePyCache().

◆ lock()

virtual void YACS::ENGINE::Container::lock ( )
pure virtual

◆ setAttachOnCloningStatus()

void Container::setAttachOnCloningStatus ( bool  val) const
virtual

If val is equal to true the current container 'this' is not destined to be deeply copied on clone call. If val is equal to false the current container 'this' is destined to be deeply copied on clone call.

Reimplemented in YACS::ENGINE::HomogeneousPoolContainer.

Definition at line 68 of file Container.cxx.

69 {
71 }

References _isAttachedOnCloning.

Referenced by FormContainer::onModifyAOC(), and YACS::ENGINE::SalomeContainer::setProperty().

◆ setName()

void YACS::ENGINE::Container::setName ( std::string  name)
inline

WARNING ! name is used in edition to identify different containers, it is not the runtime name of the container

Definition at line 83 of file Container.hxx.

83 { _name = name; }

Referenced by YACS::ENGINE::Proc::createContainer(), YACS::servertypeParser< T >::loadcontainer(), YACS::HMI::CommandRenameContainer::localExecute(), YACS::HMI::CommandAddContainerBase::localExecute(), and YACS::HMI::CommandRenameContainer::localReverse().

◆ setProc()

void YACS::ENGINE::Container::setProc ( Proc proc)
inline

◆ setProperties()

void Container::setProperties ( const std::map< std::string, std::string > &  properties)
virtual

Definition at line 103 of file Container.cxx.

104 {
105  for (std::map<std::string,std::string>::const_iterator it=properties.begin();it!=properties.end();++it)
106  setProperty((*it).first,(*it).second);
107 }
virtual void setProperty(const std::string &name, const std::string &value)=0

References setProperty().

Referenced by YACS::HMI::CommandAddContainerBase::localExecute().

◆ setProperty()

virtual void YACS::ENGINE::Container::setProperty ( const std::string &  name,
const std::string &  value 
)
pure virtual

◆ shutdown()

◆ start() [1/2]

◆ start() [2/2]

void Container::start ( const Task askingNode,
const std::string &  resource_name,
const std::string &  container_name 
)
virtual

Reimplemented in YACS::ENGINE::SalomeContainer.

Definition at line 52 of file Container.cxx.

55 {
56  return start(askingNode);
57 }
virtual void start(const Task *askingNode)=0

References start().

◆ unLock()

virtual void YACS::ENGINE::Container::unLock ( )
pure virtual

◆ usePythonCache()

void Container::usePythonCache ( bool  v)
virtual

Definition at line 125 of file Container.cxx.

126 {
127  if(v)
129  else
131 }

References setProperty(), and USE_PYCACHE_PROPERTY.

Referenced by FormAdvParamContainer::onModifyUsePyCache().

Member Data Documentation

◆ _isAttachedOnCloning

◆ _name

std::string YACS::ENGINE::Container::_name
protected

Definition at line 91 of file Container.hxx.

Referenced by YACS::ENGINE::SalomeContainer::shutdown().

◆ _proc

Proc* YACS::ENGINE::Container::_proc
protected

Definition at line 93 of file Container.hxx.

◆ AOC_ENTRY

◆ KIND_ENTRY

const char Container::KIND_ENTRY ="container_kind"
static

◆ USE_PYCACHE_PROPERTY

const char Container::USE_PYCACHE_PROPERTY ="use_py_cache"
static

Definition at line 89 of file Container.hxx.

Referenced by isUsingPythonCache(), and usePythonCache().


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