C++ implementation of Engines::Component interface. More...
#include <SALOME_Component_i.hxx>
Public Member Functions | |
Engines_Component_i () | |
Default constructor, not for use. More... | |
Engines_Component_i (CORBA::ORB_ptr orb, 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. More... | |
Engines_Component_i (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, Engines::Container_ptr container, const char *instanceName, const char *interfaceName, bool notif=false, bool regist=true) | |
Standard Constructor for standalone Component, used in derived class. More... | |
CORBA::Boolean | isSSLMode () override |
virtual | ~Engines_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::FieldsDict * | getProperties () |
CORBA method: returns a previously stored map (key=string,value=any) as a sequence. More... | |
virtual void | SetOption (const char *, const char *) |
CORBA method: This method is to set an option specific to a certain EngineComponent. More... | |
virtual char * | GetOption (const char *) |
CORBA method: This method is to get value of an option specific to a certain EngineComponent. 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::TMPFile * | DumpPython (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) |
virtual bool | hasObjectInfo () |
Return true if component can provide creation information. More... | |
virtual char * | getObjectInfo (const char *entry) |
Get creation information for object addressed by given entry. More... | |
virtual char * | getVersion () |
Get version of the component. More... | |
PortableServer::ObjectId * | getId () |
C++ method: return CORBA instance id, the id is set in derived class constructor, when instance is activated. More... | |
Engines_Container_i * | GetContainerPtr () |
C++ method: return Container Servant. More... | |
std::string | getContainerName () |
C++ method: return the name of the container associated with this component This name does not contains the "/Containers" string and all "/" are replaced by "_". More... | |
void | setContainerName () |
C++ method: set the name of the container associated with this component (attribute containerName) This name does not contains the "/Containers" string and all "/" are replaced by "</em>". 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... | |
virtual void | configureSalome_file (std::string service_name, std::string file_port_name, Salome_file_i *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, Salome_file_i * > | _t_Salome_file_map |
typedef std::map< std::string, Engines_Component_i::_t_Salome_file_map * > | _t_Service_file_map |
Protected Member Functions | |
SALOME_NamingService_Abstract * | getNS () |
Protected Attributes | |
std::string | _instanceName |
std::string | _interfaceName |
std::string | _containerName |
CORBA::ORB_var | _orb |
PortableServer::POA_var | _poa |
PortableServer::ObjectId * | _id |
PortableServer::ObjectId * | _contId |
Engines::Container_var | _container |
Engines_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 |
std::string | _serviceName |
std::string | _graphName |
std::string | _nodeName |
Static Protected Attributes | |
static bool | _isMultiInstance = false |
Private Attributes | |
pthread_t | _ThreadId |
long | _StartUsed |
long | _ThreadCpuUsed |
bool | _Executed |
bool | _CanceledThread |
C++ implementation of Engines::Component interface.
|
protected |
|
protected |
Engines_Component_i::Engines_Component_i | ( | ) |
Default constructor, not for use.
References MESSAGE.
Engines_Component_i::Engines_Component_i | ( | CORBA::ORB_ptr | orb, |
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
orb | Object Request broker given by Container |
poa | Portable Object Adapter from Container (normally root_poa) |
contId | container CORBA id inside the server |
instanceName | unique instance name for this object (see Container_i) |
interfaceName | component class name |
notif | use of notification |
regist | (true or false) use of registry (default true) |
References _container, _contId, _instanceName, _myConnexionToRegistry, _notifSupplier, _orb, _poa, getNS(), instanceName(), MESSAGE, salome::orb, SALOME_ContainerPy::poa, and setContainerName().
Engines_Component_i::Engines_Component_i | ( | CORBA::ORB_ptr | orb, |
PortableServer::POA_ptr | poa, | ||
Engines::Container_ptr | container, | ||
const char * | instanceName, | ||
const char * | interfaceName, | ||
bool | notif = false , |
||
bool | regist = true |
||
) |
Standard Constructor for standalone Component, used in derived class.
Connection to Registry and Notification
orb | Object Request broker given by Container |
poa | Portable Object Adapter from Container (normally root_poa) |
container | container CORBA reference |
instanceName | unique instance name for this object (see Container_i) |
interfaceName | component class name |
notif | use of notification |
regist | (true or false) use of registry (default true) |
References _container, _instanceName, _myConnexionToRegistry, _notifSupplier, _orb, _poa, TestComponentPy::container, getNS(), instanceName(), MESSAGE, salome::orb, SALOME_ContainerPy::poa, and setContainerName().
|
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, Abstract_Engines_Container_i::decInstanceCnt(), MESSAGE, SALOME_ContainerPy::poa, and SCRUTE.
void Engines_Component_i::beginService | ( | const char * | serviceName | ) |
C++ method: used by derived classes for supervision.
References _Executed, _fieldsDict, _instanceName, _serviceName, _StartUsed, _ThreadCpuUsed, _ThreadId, CpuUsed_impl(), MESSAGE, and theEngines_Component.
Referenced by Superv_Component_i::beginService().
void Engines_Component_i::CancelThread | ( | ) |
|
virtual |
|
virtual |
|
virtual |
C++ method: used to configure the Salome_file into the runtime.
service_name | name of the service that use this Salome_file |
file_port_name | name of the Salome_file |
file | Salome_file C++ object |
Referenced by checkInputFilesToService(), and checkOutputFilesToService().
long Engines_Component_i::CpuUsed | ( | ) |
C++ method:
References _Executed, _StartUsed, _ThreadId, and prepare_test::usage.
Referenced by CpuUsed_impl(), and SetCurCpu().
CORBA::Long Engines_Component_i::CpuUsed_impl | ( | ) |
CORBA method:
References _Executed, _Sleeping, _ThreadCpuUsed, _ThreadId, CpuUsed(), Killer(), and theEngines_Component.
Referenced by beginService(), SALOME_ComponentPy.SALOME_ComponentPy_Gen_i::beginService(), endService(), and SALOME_ComponentPy.SALOME_ComponentPy_Gen_i::endService().
void Engines_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) –
|
virtual |
C++ method: DumpPython default implementation.
void Engines_Component_i::endService | ( | const char * | serviceName | ) |
C++ method: used by derived classes for supervision.
References _CanceledThread, _instanceName, _StartUsed, _ThreadCpuUsed, _ThreadId, CpuUsed_impl(), and MESSAGE.
std::string Engines_Component_i::getContainerName | ( | ) |
C++ method: return the name of the container associated with this component This name does not contains the "/Containers" string and all "/" are replaced by "_".
References _containerName.
Referenced by create_calcium_port(), CalciumInterface::ecp_cd(), CalciumInterface::ecp_ecriture(), CalciumInterface::ecp_effi(), CalciumInterface::ecp_efft(), CalciumInterface::ecp_fin(), CalciumInterface::ecp_fini(), CalciumInterface::ecp_fint(), and CalciumInterface::ecp_lecture().
Engines_Container_i * Engines_Component_i::GetContainerPtr | ( | ) |
C++ method: return Container Servant.
References _container, and _poa.
Engines::Container_ptr Engines_Component_i::GetContainerRef | ( | ) |
CORBA method: return CORBA reference of the Container.
References _container.
Referenced by setInputFileToService(), and setOutputFileToService().
|
static |
C++ method: return standard library name built on component name.
References waitContainers::cname, and TestKernelHelpers::ret.
Referenced by Abstract_Engines_Container_i::decInstanceCnt(), and Engines_Parallel_Container_i::decInstanceCnt().
PortableServer::ObjectId * Engines_Component_i::getId | ( | ) |
C++ method: return CORBA instance id, the id is set in derived class constructor, when instance is activated.
References _id.
Referenced by SalomeTestComponentEngine_factory(), and TestMPIComponentEngine_factory().
|
virtual |
|
protected |
References KERNEL::GetRefToORB(), SALOME_NamingService::init_orb(), SINGLETON_< TYPE >::Instance(), and salome::orb.
Referenced by Engines_Component_i().
|
virtual |
Get creation information for object addressed by given entry.
|
virtual |
CORBA method: This method is to get value of an option specific to a certain EngineComponent.
|
virtual |
Engines::FieldsDict * Engines_Component_i::getProperties | ( | ) |
CORBA method: returns a previously stored map (key=string,value=any) as a sequence.
(see setProperties)
References _fieldsDict.
|
virtual |
Get version of the component.
This method is supposed to be implemented in all derived classes; default implementation returns empty string that means that no version information about the component is available.
Referenced by SALOME_DriverPy.SALOME_DriverPy_i::Version().
char * Engines_Component_i::graphName | ( | ) |
C++ method: – CHECK IF USED –.
References _graphName.
Referenced by Names(), and SALOME_ComponentPy.SALOME_ComponentPy_Gen_i::sendMessage().
|
virtual |
Return true
if component can provide creation information.
char * Engines_Component_i::instanceName | ( | ) |
CORBA method: return name of the instance, unique in this Container.
References _instanceName.
Referenced by create_calcium_port(), CalciumInterface::ecp_cd(), CalciumInterface::ecp_ecriture(), CalciumInterface::ecp_effi(), CalciumInterface::ecp_efft(), CalciumInterface::ecp_fin(), CalciumInterface::ecp_fini(), CalciumInterface::ecp_fint(), CalciumInterface::ecp_lecture(), Engines_Component_i(), Engines_DSC_i::Engines_DSC_i(), and Superv_Component_i::Superv_Component_i().
char * Engines_Component_i::interfaceName | ( | ) |
CORBA method: return name of the component class.
References _interfaceName.
|
static |
|
override |
bool Engines_Component_i::Kill_impl | ( | ) |
bool Engines_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().
void Engines_Component_i::Names | ( | const char * | graphName, |
const char * | nodeName | ||
) |
CORBA method: used by Supervision to give names to this instance.
References _graphName, _nodeName, graphName(), and nodeName().
char * Engines_Component_i::nodeName | ( | ) |
C++ method: – CHECK IF USED –.
References _nodeName.
Referenced by SALOME_PyNode.PyScriptNode_i::assignNewCompiledCode(), SALOME_PyNode.PyScriptNode_i::assignVarInContext(), SALOME_PyNode.PyScriptNode_i::callMethodOnVarInContext(), SALOME_PyNode.PyNode_i::execute(), SALOME_PyNode.PyScriptNode_i::execute(), SALOME_PyNode.PyNode_i::executeAnotherPieceOfCode(), SALOME_PyNode.PyScriptNode_i::executeAnotherPieceOfCode(), SALOME_PyNode.PyScriptNode_i::executeFirst(), SALOME_PyNode.PyScriptNode_i::executeSecond(), SALOME_PyNode.PyScriptNode_i::executeSimple(), SALOME_PyNode.PyNode_i::getName(), SALOME_PyNode.PyScriptNode_i::getName(), SALOME_PyNode.PyScriptNode_i::getValueOfVarInContext(), Names(), and SALOME_ComponentPy.SALOME_ComponentPy_Gen_i::sendMessage().
void Engines_Component_i::ping | ( | ) |
CORBA method: Test if instance is alive and responds.
References MESSAGE.
bool Engines_Component_i::Resume_impl | ( | ) |
CORBA method: used in Supervision.
References _id, _instanceName, _interfaceName, _Sleeping, _ThreadId, Kernel_Utils::GetHostname(), and MESSAGE.
void Engines_Component_i::sendMessage | ( | const char * | event_type, |
const char * | message | ||
) |
C++ method: Send message to event channel.
References _graphName, _nodeName, _notifSupplier, and NOTIFICATION_Supplier::Send().
void Engines_Component_i::setContainerName | ( | ) |
C++ method: set the name of the container associated with this component (attribute containerName) This name does not contains the "/Containers" string and all "/" are replaced by "</em>".
References _container, _containerName, SALOME_ContainerPy::containerName, and pythfilter::name.
Referenced by Engines_Component_i().
void Engines_Component_i::SetCurCpu | ( | ) |
|
virtual |
|
virtual |
CORBA method: This method is to set an option specific to a certain EngineComponent.
|
virtual |
void Engines_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.
dico | sequence of (key=string,value=any) |
References _fieldsDict.
bool Engines_Component_i::Stop_impl | ( | ) |
CORBA method: used in Supervision.
References _id, _instanceName, _interfaceName, _ThreadId, Kernel_Utils::GetHostname(), Killer(), and MESSAGE.
bool Engines_Component_i::Suspend_impl | ( | ) |
CORBA method: used in Supervision.
References _id, _instanceName, _interfaceName, _Sleeping, _ThreadId, Kernel_Utils::GetHostname(), Killer(), and MESSAGE.
|
private |
Referenced by CancelThread(), and endService().
|
protected |
|
protected |
Referenced by SALOME_ContainerPy.SALOME_ContainerPy_Gen_i::_get_name(), SALOME_ContainerPy.SALOME_ContainerPy_Gen_i::create_component_instance(), SALOME_Container.SALOME_Container_i::create_component_instance(), getContainerName(), setContainerName(), and SALOME_ContainerPy.SALOME_ContainerPy_Gen_i::Shutdown().
|
protected |
|
private |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by checkInputFilesToService(), getInputFileToService(), and setInputFileToService().
|
protected |
Referenced by SALOME_ComponentPy.SALOME_ComponentPy_Gen_i::_get_instanceName(), beginService(), SALOME_ComponentPy.SALOME_ComponentPy_Gen_i::beginService(), endService(), SALOME_ComponentPy.SALOME_ComponentPy_Gen_i::endService(), Engines_Component_i(), instanceName(), Resume_impl(), Stop_impl(), and Suspend_impl().
|
protected |
|
staticprotected |
|
protected |
Referenced by Engines_Component_i(), and ~Engines_Component_i().
|
protected |
|
protected |
|
protected |
Referenced by SALOME_Container.SALOME_Container_i::__init__(), SALOME_ContainerPy.SALOME_ContainerPy_Gen_i::__init__(), SALOME_ContainerPy.SALOME_ContainerPy_i::__init__(), SALOME_ComponentPy.SALOME_ComponentPy_Gen_i::__init__(), SALOME_NamingServicePy.SALOME_NamingServicePy_i::__init__(), SALOME_ContainerPy.SALOME_ContainerPy_Gen_i::create_component_instance(), SALOME_Container.SALOME_Container_i::create_component_instance(), SALOME_Container.SALOME_Container_i::create_pynode(), SALOME_Container.SALOME_Container_i::create_pyscriptnode(), Engines_Component_i(), SALOME_Embedded_NamingService_ClientPy.SALOME_Embedded_NamingService_ClientPy::Register(), SALOME_Embedded_NamingService_ClientPy.SALOME_Embedded_NamingService_ClientPy::Resolve(), and SALOME_ContainerPy.SALOME_ContainerPy_Gen_i::Shutdown().
|
protected |
Referenced by checkOutputFilesToService(), getOutputFileToService(), and setOutputFileToService().
|
protected |
Referenced by SALOME_Container.SALOME_Container_i::__init__(), SALOME_ContainerPy.SALOME_ContainerPy_Gen_i::__init__(), SALOME_ComponentPy.SALOME_ComponentPy_Gen_i::__init__(), SALOME_ContainerPy.SALOME_ContainerPy_Gen_i::create_component_instance(), SALOME_Container.SALOME_Container_i::create_component_instance(), SALOME_Container.SALOME_Container_i::create_pynode(), SALOME_Container.SALOME_Container_i::create_pyscriptnode(), destroy(), SALOME_ComponentPy.SALOME_ComponentPy_Gen_i::destroy(), Engines_Component_i(), Engines_TestComponent_i::Engines_TestComponent_i(), GetContainerPtr(), isSSLMode(), and TestMPIComponentEngine::TestMPIComponentEngine().
|
protected |
Referenced by getInputFileToService(), getOutputFileToService(), setInputFileToService(), and setOutputFileToService().
|
protected |
|
protected |
|
private |
|
protected |
|
private |
|
private |
Referenced by beginService(), SALOME_ComponentPy.SALOME_ComponentPy_Gen_i::beginService(), CpuUsed(), CpuUsed_impl(), SALOME_ComponentPy.SALOME_ComponentPy_Gen_i::CpuUsed_impl(), endService(), SALOME_ComponentPy.SALOME_ComponentPy_Gen_i::endService(), Kill_impl(), SALOME_ComponentPy.SALOME_ComponentPy_Gen_i::Kill_impl(), Resume_impl(), SALOME_ComponentPy.SALOME_ComponentPy_Gen_i::Resume_impl(), Stop_impl(), SALOME_ComponentPy.SALOME_ComponentPy_Gen_i::Stop_impl(), Suspend_impl(), and SALOME_ComponentPy.SALOME_ComponentPy_Gen_i::Suspend_impl().