Version: 9.12.0
Engines_Parallel_Component_i Class Reference

#include <SALOME_ParallelComponent_i.hxx>

Inheritance diagram for Engines_Parallel_Component_i:

Public Member Functions

 Engines_Parallel_Component_i (CORBA::ORB_ptr orb, char *ior, int rank, PortableServer::POA_ptr poa, PortableServer::ObjectId *contId, const char *instanceName, const char *interfaceName, bool notif=false, bool regist=true)
 Standard Constructor for generic Component, used in derived class Connection to Registry and Notification. More...
 
virtual ~Engines_Parallel_Component_i ()
 Destructor: call Container for decrement of instances count. More...
 
char * instanceName ()
 CORBA method: return name of the instance, unique in this Container. More...
 
char * interfaceName ()
 CORBA method: return name of the component class. More...
 
void ping ()
 CORBA method: Test if instance is alive and responds. More...
 
void destroy ()
 CORBA method: Deactivate this instance. More...
 
Engines::Container_ptr GetContainerRef ()
 CORBA method: return CORBA reference of the Container. More...
 
void setProperties (const Engines::FieldsDict &dico)
 CORBA method: Gives a sequence of (key=string,value=any) to the component. More...
 
Engines::FieldsDictgetProperties ()
 CORBA method: returns a previously stored map (key=string,value=any) as a sequence. More...
 
void Names (const char *graphName, const char *nodeName)
 CORBA method: used by Supervision to give names to this instance. More...
 
bool Kill_impl ()
 CORBA method: used in Supervision. More...
 
bool Stop_impl ()
 CORBA method: used in Supervision. More...
 
bool Suspend_impl ()
 CORBA method: used in Supervision. More...
 
bool Resume_impl ()
 CORBA method: used in Supervision. More...
 
CORBA::Long CpuUsed_impl ()
 CORBA method: More...
 
virtual Engines::TMPFileDumpPython (CORBA::Boolean isPublished, CORBA::Boolean isMultiFile, CORBA::Boolean &isValidScript)
 C++ method: DumpPython default implementation. More...
 
virtual Engines::Salome_file_ptr getInputFileToService (const char *service_name, const char *Salome_file_name)
 
virtual Engines::Salome_file_ptr getOutputFileToService (const char *service_name, const char *Salome_file_name)
 
virtual void checkInputFilesToService (const char *service_name)
 
virtual Engines::Salome_file_ptr setInputFileToService (const char *service_name, const char *Salome_file_name)
 
virtual void checkOutputFilesToService (const char *service_name)
 
virtual Engines::Salome_file_ptr setOutputFileToService (const char *service_name, const char *Salome_file_name)
 
void send_parallel_proxy_object (CORBA::Object_ptr proxy_ref)
 C++ method: Used by the Parallel Component to deploy a Parallel Salome_file. More...
 
virtual bool hasObjectInfo ()
 
virtual char * getObjectInfo (const char *entry)
 
PortableServer::ObjectId * getId ()
 C++ method: return CORBA instance id, the id is set in derived class constructor, when instance is activated. More...
 
Engines_Parallel_Container_iGetContainerPtr ()
 C++ method: return Container Servant. More...
 
void beginService (const char *serviceName)
 C++ method: used by derived classes for supervision. More...
 
void endService (const char *serviceName)
 C++ method: used by derived classes for supervision. More...
 
void sendMessage (const char *event_type, const char *message)
 C++ method: Send message to event channel. More...
 
char * graphName ()
 C++ method: – CHECK IF USED –. More...
 
char * nodeName ()
 C++ method: – CHECK IF USED –. More...
 
bool Killer (pthread_t ThreadId, int signum)
 C++ method: used in Supervision (see kill_impl) More...
 
void SetCurCpu ()
 C++ method: More...
 
long CpuUsed ()
 C++ method: More...
 
void CancelThread ()
 C++ method: More...
 
void wait_parallel_object_proxy ()
 C++ method: Used by the Parallel Component to deploy a Parallel Salome_file. More...
 
char * get_parallel_proxy_object ()
 C++ method: Used by the Parallel Component to deploy a Parallel Salome_file. More...
 
virtual void configureSalome_file (std::string service_name, std::string file_port_name, Engines::Parallel_Salome_file_proxy_impl *file)
 C++ method: used to configure the Salome_file into the runtime. More...
 

Static Public Member Functions

static bool isMultiInstance ()
 
static std::string GetDynLibraryName (const char *componentName)
 C++ method: return standard library name built on component name. More...
 

Protected Types

typedef std::map< std::string, Parallel_Salome_file_i * > _t_Salome_file_map
 
typedef std::map< std::string, Engines::Parallel_Salome_file_proxy_impl * > _t_Proxy_Salome_file_map
 
typedef std::map< std::string, std::string > _t_IOR_Proxy_Salome_file_map
 
typedef std::map< std::string, Engines_Parallel_Component_i::_t_Salome_file_map * > _t_Service_file_map
 
typedef std::map< std::string, Engines_Parallel_Component_i::_t_Proxy_Salome_file_map * > _t_Proxy_Service_file_map
 
typedef std::map< std::string, Engines_Parallel_Component_i::_t_IOR_Proxy_Salome_file_map * > _t_IOR_Proxy_Service_file_map
 

Protected Attributes

std::string _instanceName
 
std::string _interfaceName
 
CORBA::ORB_var _orb
 
PortableServer::POA_var _poa
 
PortableServer::ObjectId * _id
 
PortableServer::ObjectId * _contId
 
Engines_Parallel_Component_i_thisObj
 
RegistryConnexion_myConnexionToRegistry
 
NOTIFICATION_Supplier_notifSupplier
 
std::map< std::string, CORBA::Any > _fieldsDict
 
_t_Service_file_map _Input_Service_file_map
 
_t_Service_file_map _Output_Service_file_map
 
_t_Service_file_map::iterator _Service_file_map_it
 
_t_Salome_file_map::iterator _Salome_file_map_it
 
_t_Proxy_Service_file_map _Proxy_Input_Service_file_map
 
_t_Proxy_Service_file_map _Proxy_Output_Service_file_map
 
_t_Proxy_Service_file_map::iterator _Proxy_Service_file_map_it
 
_t_Proxy_Salome_file_map::iterator _Proxy_Salome_file_map_it
 
_t_IOR_Proxy_Service_file_map _IOR_Proxy_Input_Service_file_map
 
_t_IOR_Proxy_Service_file_map _IOR_Proxy_Output_Service_file_map
 
_t_IOR_Proxy_Service_file_map::iterator _IOR_Proxy_Service_file_map_it
 
_t_IOR_Proxy_Salome_file_map::iterator _IOR_Proxy_Salome_file_map_it
 
std::string _serviceName
 
std::string _graphName
 
std::string _nodeName
 
pthread_mutex_t * deploy_mutex
 
char * _proxy
 

Static Protected Attributes

static bool _isMultiInstance = false
 

Private Attributes

pthread_t _ThreadId
 
long _StartUsed
 
long _ThreadCpuUsed
 
bool _Executed
 
bool _CanceledThread
 
bool _destroyed
 

Member Typedef Documentation

◆ _t_IOR_Proxy_Salome_file_map

typedef std::map<std::string, std::string> Engines_Parallel_Component_i::_t_IOR_Proxy_Salome_file_map
protected

◆ _t_IOR_Proxy_Service_file_map

◆ _t_Proxy_Salome_file_map

typedef std::map<std::string, Engines::Parallel_Salome_file_proxy_impl*> Engines_Parallel_Component_i::_t_Proxy_Salome_file_map
protected

◆ _t_Proxy_Service_file_map

◆ _t_Salome_file_map

◆ _t_Service_file_map

Constructor & Destructor Documentation

◆ Engines_Parallel_Component_i()

Engines_Parallel_Component_i::Engines_Parallel_Component_i ( CORBA::ORB_ptr  orb,
char *  ior,
int  rank,
PortableServer::POA_ptr  poa,
PortableServer::ObjectId *  contId,
const char *  instanceName,
const char *  interfaceName,
bool  notif = false,
bool  regist = true 
)

Standard Constructor for generic Component, used in derived class Connection to Registry and Notification.

Parameters
orbObject Request broker given by Container \parap poa Portable Object Adapter from Container (normally root_poa)
contIdcontainer CORBA id inside the server
instanceNameunique instance name for this object (see Container_i)
interfaceNamecomponent class name
notifuse of notification

References _contId, _instanceName, _myConnexionToRegistry, _notifSupplier, _orb, _poa, _proxy, deploy_mutex, instanceName(), MESSAGE, salome::orb, and SALOME_ContainerPy::poa.

◆ ~Engines_Parallel_Component_i()

Engines_Parallel_Component_i::~Engines_Parallel_Component_i ( )
virtual

Destructor: call Container for decrement of instances count.

When instances count falls to 0, the container tries to remove the component library (dlclose)

References _id, _interfaceName, _myConnexionToRegistry, _notifSupplier, _proxy, Engines_Parallel_Container_i::decInstanceCnt(), deploy_mutex, and MESSAGE.

Member Function Documentation

◆ beginService()

void Engines_Parallel_Component_i::beginService ( const char *  serviceName)

C++ method: used by derived classes for supervision.

References _Executed, _fieldsDict, _instanceName, _serviceName, _StartUsed, _ThreadCpuUsed, _ThreadId, CpuUsed_impl(), and MESSAGE.

◆ CancelThread()

void Engines_Parallel_Component_i::CancelThread ( )

C++ method:

References _CanceledThread.

Referenced by CallCancelThread().

◆ checkInputFilesToService()

void Engines_Parallel_Component_i::checkInputFilesToService ( const char *  service_name)
virtual

◆ checkOutputFilesToService()

void Engines_Parallel_Component_i::checkOutputFilesToService ( const char *  service_name)
virtual

◆ configureSalome_file()

void Engines_Parallel_Component_i::configureSalome_file ( std::string  service_name,
std::string  file_port_name,
Engines::Parallel_Salome_file_proxy_impl *  file 
)
virtual

C++ method: used to configure the Salome_file into the runtime.

Parameters
service_namename of the service that use this Salome_file
file_port_namename of the Salome_file
fileParallel Salome_file C++ object

Referenced by checkInputFilesToService(), and checkOutputFilesToService().

◆ CpuUsed()

long Engines_Parallel_Component_i::CpuUsed ( )

C++ method:

References _Executed, _StartUsed, _ThreadId, and prepare_test::usage.

Referenced by CpuUsed_impl(), and SetCurCpu().

◆ CpuUsed_impl()

◆ destroy()

void Engines_Parallel_Component_i::destroy ( )

CORBA method: Deactivate this instance.

CORBA object is deactivated (do not respond any more to CORBA calls), the connection to Regsitry is removed (Registry informed of deactivation), internal server reference counter on the derived servant class is decremented, to allow destruction of the class (delete) by POA, when there are no more references. – TO BE USED BY CONTAINER ONLY (Container housekeeping) –

References _destroyed, and MESSAGE.

◆ DumpPython()

Engines::TMPFile * Engines_Parallel_Component_i::DumpPython ( CORBA::Boolean  isPublished,
CORBA::Boolean  isMultiFile,
CORBA::Boolean &  isValidScript 
)
virtual

C++ method: DumpPython default implementation.

◆ endService()

void Engines_Parallel_Component_i::endService ( const char *  serviceName)

C++ method: used by derived classes for supervision.

References _CanceledThread, _instanceName, _StartUsed, _ThreadCpuUsed, _ThreadId, CpuUsed_impl(), and MESSAGE.

◆ get_parallel_proxy_object()

char * Engines_Parallel_Component_i::get_parallel_proxy_object ( )

C++ method: Used by the Parallel Component to deploy a Parallel Salome_file.

References _proxy.

Referenced by setInputFileToService(), setOutputFileToService(), and wait_parallel_object_proxy().

◆ GetContainerPtr()

Engines_Parallel_Container_i * Engines_Parallel_Component_i::GetContainerPtr ( )

C++ method: return Container Servant.

References _contId, and _poa.

◆ GetContainerRef()

Engines::Container_ptr Engines_Parallel_Component_i::GetContainerRef ( )

CORBA method: return CORBA reference of the Container.

References _contId, _poa, and MESSAGE.

◆ GetDynLibraryName()

std::string Engines_Parallel_Component_i::GetDynLibraryName ( const char *  componentName)
static

C++ method: return standard library name built on component name.

References TestKernelHelpers::ret.

◆ getId()

PortableServer::ObjectId * Engines_Parallel_Component_i::getId ( )

C++ method: return CORBA instance id, the id is set in derived class constructor, when instance is activated.

References _id.

◆ getInputFileToService()

Engines::Salome_file_ptr Engines_Parallel_Component_i::getInputFileToService ( const char *  service_name,
const char *  Salome_file_name 
)
virtual

◆ getObjectInfo()

virtual char* Engines_Parallel_Component_i::getObjectInfo ( const char *  entry)
virtual

◆ getOutputFileToService()

Engines::Salome_file_ptr Engines_Parallel_Component_i::getOutputFileToService ( const char *  service_name,
const char *  Salome_file_name 
)
virtual

◆ getProperties()

Engines::FieldsDict * Engines_Parallel_Component_i::getProperties ( )

CORBA method: returns a previously stored map (key=string,value=any) as a sequence.

(see setProperties)

References _fieldsDict.

◆ graphName()

char * Engines_Parallel_Component_i::graphName ( )

C++ method: – CHECK IF USED –.

References _graphName.

Referenced by Names(), sendMessage(), and SALOME_ComponentPy.SALOME_ComponentPy_Gen_i::sendMessage().

◆ hasObjectInfo()

virtual bool Engines_Parallel_Component_i::hasObjectInfo ( )
virtual

◆ instanceName()

char * Engines_Parallel_Component_i::instanceName ( )

CORBA method: return name of the instance, unique in this Container.

References _instanceName.

Referenced by Engines_Parallel_Component_i().

◆ interfaceName()

char * Engines_Parallel_Component_i::interfaceName ( )

CORBA method: return name of the component class.

References _interfaceName.

◆ isMultiInstance()

static bool Engines_Parallel_Component_i::isMultiInstance ( )
static

◆ Kill_impl()

bool Engines_Parallel_Component_i::Kill_impl ( )

CORBA method: used in Supervision.

References _ThreadId, and Killer().

◆ Killer()

bool Engines_Parallel_Component_i::Killer ( pthread_t  ThreadId,
int  signum 
)

C++ method: used in Supervision (see kill_impl)

References MESSAGE.

Referenced by CpuUsed_impl(), Kill_impl(), Stop_impl(), and Suspend_impl().

◆ Names()

void Engines_Parallel_Component_i::Names ( const char *  graphName,
const char *  nodeName 
)

CORBA method: used by Supervision to give names to this instance.

References _graphName, _nodeName, graphName(), MESSAGE, and nodeName().

◆ nodeName()

◆ ping()

void Engines_Parallel_Component_i::ping ( )

CORBA method: Test if instance is alive and responds.

References MESSAGE.

◆ Resume_impl()

bool Engines_Parallel_Component_i::Resume_impl ( )

CORBA method: used in Supervision.

References _id, _instanceName, _interfaceName, _Sleeping, _ThreadId, Kernel_Utils::GetHostname(), and MESSAGE.

◆ send_parallel_proxy_object()

void Engines_Parallel_Component_i::send_parallel_proxy_object ( CORBA::Object_ptr  proxy_ref)

C++ method: Used by the Parallel Component to deploy a Parallel Salome_file.

References _orb, and _proxy.

◆ sendMessage()

void Engines_Parallel_Component_i::sendMessage ( const char *  event_type,
const char *  message 
)

C++ method: Send message to event channel.

References _notifSupplier, graphName(), nodeName(), and NOTIFICATION_Supplier::Send().

◆ SetCurCpu()

void Engines_Parallel_Component_i::SetCurCpu ( )

C++ method:

References _ThreadCpuUsed, and CpuUsed().

Referenced by SetCpuUsed().

◆ setInputFileToService()

Engines::Salome_file_ptr Engines_Parallel_Component_i::setInputFileToService ( const char *  service_name,
const char *  Salome_file_name 
)
virtual

◆ setOutputFileToService()

Engines::Salome_file_ptr Engines_Parallel_Component_i::setOutputFileToService ( const char *  service_name,
const char *  Salome_file_name 
)
virtual

◆ setProperties()

void Engines_Parallel_Component_i::setProperties ( const Engines::FieldsDict dico)

CORBA method: Gives a sequence of (key=string,value=any) to the component.

Base class component stores the sequence in a map. The map is cleared before. This map is for use by derived classes.

Parameters
dicosequence of (key=string,value=any)

References _fieldsDict.

◆ Stop_impl()

bool Engines_Parallel_Component_i::Stop_impl ( )

CORBA method: used in Supervision.

References _id, _instanceName, _interfaceName, _ThreadId, Kernel_Utils::GetHostname(), Killer(), and MESSAGE.

◆ Suspend_impl()

bool Engines_Parallel_Component_i::Suspend_impl ( )

CORBA method: used in Supervision.

References _id, _instanceName, _interfaceName, _Sleeping, _ThreadId, Kernel_Utils::GetHostname(), Killer(), and MESSAGE.

◆ wait_parallel_object_proxy()

void Engines_Parallel_Component_i::wait_parallel_object_proxy ( )

C++ method: Used by the Parallel Component to deploy a Parallel Salome_file.

References get_parallel_proxy_object().

Referenced by setInputFileToService(), and setOutputFileToService().

Field Documentation

◆ _CanceledThread

bool Engines_Parallel_Component_i::_CanceledThread
private

Referenced by CancelThread(), and endService().

◆ _contId

◆ _destroyed

bool Engines_Parallel_Component_i::_destroyed
private

Referenced by destroy().

◆ _Executed

◆ _fieldsDict

std::map<std::string,CORBA::Any> Engines_Parallel_Component_i::_fieldsDict
protected

◆ _graphName

◆ _id

PortableServer::ObjectId* Engines_Parallel_Component_i::_id
protected

◆ _Input_Service_file_map

_t_Service_file_map Engines_Parallel_Component_i::_Input_Service_file_map
protected

Referenced by setInputFileToService().

◆ _instanceName

◆ _interfaceName

◆ _IOR_Proxy_Input_Service_file_map

_t_IOR_Proxy_Service_file_map Engines_Parallel_Component_i::_IOR_Proxy_Input_Service_file_map
protected

Referenced by setInputFileToService().

◆ _IOR_Proxy_Output_Service_file_map

_t_IOR_Proxy_Service_file_map Engines_Parallel_Component_i::_IOR_Proxy_Output_Service_file_map
protected

Referenced by setOutputFileToService().

◆ _IOR_Proxy_Salome_file_map_it

_t_IOR_Proxy_Salome_file_map::iterator Engines_Parallel_Component_i::_IOR_Proxy_Salome_file_map_it
protected

◆ _IOR_Proxy_Service_file_map_it

_t_IOR_Proxy_Service_file_map::iterator Engines_Parallel_Component_i::_IOR_Proxy_Service_file_map_it
protected

◆ _isMultiInstance

bool Engines_Parallel_Component_i::_isMultiInstance = false
staticprotected

◆ _myConnexionToRegistry

RegistryConnexion* Engines_Parallel_Component_i::_myConnexionToRegistry
protected

◆ _nodeName

◆ _notifSupplier

◆ _orb

◆ _Output_Service_file_map

_t_Service_file_map Engines_Parallel_Component_i::_Output_Service_file_map
protected

Referenced by setOutputFileToService().

◆ _poa

◆ _proxy

◆ _Proxy_Input_Service_file_map

_t_Proxy_Service_file_map Engines_Parallel_Component_i::_Proxy_Input_Service_file_map
protected

◆ _Proxy_Output_Service_file_map

_t_Proxy_Service_file_map Engines_Parallel_Component_i::_Proxy_Output_Service_file_map
protected

◆ _Proxy_Salome_file_map_it

_t_Proxy_Salome_file_map::iterator Engines_Parallel_Component_i::_Proxy_Salome_file_map_it
protected

◆ _Proxy_Service_file_map_it

_t_Proxy_Service_file_map::iterator Engines_Parallel_Component_i::_Proxy_Service_file_map_it
protected

◆ _Salome_file_map_it

_t_Salome_file_map::iterator Engines_Parallel_Component_i::_Salome_file_map_it
protected

◆ _Service_file_map_it

_t_Service_file_map::iterator Engines_Parallel_Component_i::_Service_file_map_it
protected

◆ _serviceName

std::string Engines_Parallel_Component_i::_serviceName
protected

◆ _StartUsed

◆ _thisObj

Engines_Parallel_Component_i* Engines_Parallel_Component_i::_thisObj
protected

◆ _ThreadCpuUsed

◆ _ThreadId

◆ deploy_mutex

pthread_mutex_t* Engines_Parallel_Component_i::deploy_mutex
protected