Version: 8.3.0
YACS::ENGINE::SalomeContainerMultiHelper Class Reference

#include <SalomeContainerHelper.hxx>

Inheritance diagram for YACS::ENGINE::SalomeContainerMultiHelper:
Collaboration diagram for YACS::ENGINE::SalomeContainerMultiHelper:

Public Member Functions

std::string getType () const
 
std::string getDftLaunchMode () const
 
SalomeContainerMultiHelperdeepCpyOnlyStaticInfo () const
 
Engines::Container_var getContainer (const Task *askingNode) const
 
bool isAlreadyStarted (const Task *askingNode) const
 
void setContainer (const Task *askingNode, Engines::Container_var cont)
 
void shutdown ()
 

Static Public Attributes

static const char TYPE_NAME [] ="multi"
 
static const char DFT_LAUNCH_MODE [] ="getorstart"
 

Private Member Functions

 ~SalomeContainerMultiHelper ()
 

Private Attributes

std::map< const
ComponentInstance
*, Engines::Container_var > 
_trueContainers
 

Additional Inherited Members

- Protected Member Functions inherited from YACS::ENGINE::SalomeContainerHelper
virtual ~SalomeContainerHelper ()
 
- Protected Attributes inherited from YACS::ENGINE::RefCounter
unsigned int _cnt
 

Detailed Description

Definition at line 74 of file SalomeContainerHelper.hxx.

Constructor & Destructor Documentation

SalomeContainerMultiHelper::~SalomeContainerMultiHelper ( )
private

Definition at line 176 of file SalomeContainerHelper.cxx.

177 {
178 }

Member Function Documentation

SalomeContainerMultiHelper * SalomeContainerMultiHelper::deepCpyOnlyStaticInfo ( ) const
virtual

Implements YACS::ENGINE::SalomeContainerHelper.

Definition at line 115 of file SalomeContainerHelper.cxx.

116 {
117  return new SalomeContainerMultiHelper;
118 }
Engines::Container_var SalomeContainerMultiHelper::getContainer ( const Task askingNode) const
virtual

Implements YACS::ENGINE::SalomeContainerHelper.

Definition at line 120 of file SalomeContainerHelper.cxx.

References _trueContainers, and YACS::ENGINE::Task::getComponent().

121 {
122  const ComponentInstance *inst(askingNode?askingNode->getComponent():0);
123  std::map<const ComponentInstance *,Engines::Container_var>::const_iterator it(_trueContainers.find(inst));
124  if(it!=_trueContainers.end())
125  return (*it).second;
126  else
127  return Engines::Container::_nil();
128 }
std::string SalomeContainerMultiHelper::getDftLaunchMode ( ) const
virtual

Implements YACS::ENGINE::SalomeContainerHelper.

Definition at line 110 of file SalomeContainerHelper.cxx.

References DFT_LAUNCH_MODE.

111 {
112  return std::string(DFT_LAUNCH_MODE);
113 }
std::string SalomeContainerMultiHelper::getType ( ) const
virtual

Implements YACS::ENGINE::SalomeContainerHelper.

Definition at line 105 of file SalomeContainerHelper.cxx.

References TYPE_NAME.

106 {
107  return TYPE_NAME;
108 }
bool SalomeContainerMultiHelper::isAlreadyStarted ( const Task askingNode) const
virtual

Implements YACS::ENGINE::SalomeContainerHelper.

Definition at line 130 of file SalomeContainerHelper.cxx.

References _trueContainers, and YACS::ENGINE::Task::getComponent().

131 {
132  const ComponentInstance *inst(askingNode?askingNode->getComponent():0);
133  if(_trueContainers.count(inst)==0)
134  return false;
135  else
136  return true;
137 }
void SalomeContainerMultiHelper::setContainer ( const Task askingNode,
Engines::Container_var  cont 
)
virtual

Implements YACS::ENGINE::SalomeContainerHelper.

Definition at line 139 of file SalomeContainerHelper.cxx.

References _trueContainers, DEBTRACE, and YACS::ENGINE::Task::getComponent().

140 {
141  const ComponentInstance *inst(askingNode?askingNode->getComponent():0);
142  _trueContainers[inst]=cont;
143 #ifdef REFCNT
144  std::map<const ComponentInstance *, Engines::Container_var >::const_iterator it;
145  for(it = _trueContainers.begin(); it != _trueContainers.end(); ++it)
146  {
147  DEBTRACE(it->second->_PR_getobj()->pd_refCount );
148  }
149 #endif
150 }
void SalomeContainerMultiHelper::shutdown ( )
virtual

Implements YACS::ENGINE::SalomeContainerHelper.

Definition at line 152 of file SalomeContainerHelper.cxx.

References _trueContainers, and DEBTRACE.

153 {
154  for(std::map<const ComponentInstance *, Engines::Container_var >::const_iterator it = _trueContainers.begin(); it != _trueContainers.end(); ++it)
155  {
156  try
157  {
158  DEBTRACE("shutdown SALOME container: " );
159  CORBA::String_var containerName=it->second->name();
160  DEBTRACE(containerName);
161  it->second->Shutdown();
162  std::cerr << "shutdown SALOME container: " << containerName << std::endl;
163  }
164  catch(CORBA::Exception&)
165  {
166  DEBTRACE("Unexpected CORBA failure detected." );
167  }
168  catch(...)
169  {
170  DEBTRACE("Unknown exception ignored." );
171  }
172  }
173  _trueContainers.clear();
174 }

Member Data Documentation

std::map<const ComponentInstance *,Engines::Container_var> YACS::ENGINE::SalomeContainerMultiHelper::_trueContainers
private

Definition at line 90 of file SalomeContainerHelper.hxx.

Referenced by getContainer(), isAlreadyStarted(), setContainer(), and shutdown().

const char SalomeContainerMultiHelper::DFT_LAUNCH_MODE ="getorstart"
static

Definition at line 88 of file SalomeContainerHelper.hxx.

Referenced by getDftLaunchMode().

const char SalomeContainerMultiHelper::TYPE_NAME ="multi"
static

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