Version: 8.3.0
Engines_DSC_i Class Referenceabstract

This class implements the interface Engines::DSC. More...

#include <DSC_i.hxx>

Inheritance diagram for Engines_DSC_i:

Public Member Functions

 Engines_DSC_i (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId *contId, const char *instanceName, const char *interfaceName, bool notif=false)
 
 Engines_DSC_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)
 
virtual ~Engines_DSC_i ()
 
virtual void add_provides_port (Ports::Port_ptr ref, const char *provides_port_name, Ports::PortProperties_ptr port_prop) throw (Engines::DSC::PortAlreadyDefined, Engines::DSC::NilPort, Engines::DSC::BadProperty)
 
virtual void add_uses_port (const char *repository_id, const char *uses_port_name, Ports::PortProperties_ptr port_prop) throw (Engines::DSC::PortAlreadyDefined, Engines::DSC::BadProperty)
 
virtual Ports::Port_ptr get_provides_port (const char *provides_port_name, const CORBA::Boolean connection_error) throw (Engines::DSC::PortNotDefined, Engines::DSC::PortNotConnected)
 
virtual Engines::DSC::uses_portget_uses_port (const char *uses_port_name) throw (Engines::DSC::PortNotDefined, Engines::DSC::PortNotConnected)
 
virtual void connect_provides_port (const char *provides_port_name) throw (Engines::DSC::PortNotDefined)
 
virtual void connect_uses_port (const char *uses_port_name, Ports::Port_ptr provides_port_ref) throw (Engines::DSC::PortNotDefined, Engines::DSC::BadPortType, Engines::DSC::NilPort)
 
virtual CORBA::Boolean is_connected (const char *port_name) throw (Engines::DSC::PortNotDefined)
 
virtual void disconnect_provides_port (const char *provides_port_name, const Engines::DSC::Message message) throw (Engines::DSC::PortNotDefined, Engines::DSC::PortNotConnected)
 
virtual void disconnect_uses_port (const char *uses_port_name, Ports::Port_ptr provides_port_ref, const Engines::DSC::Message message) throw (Engines::DSC::PortNotDefined, Engines::DSC::PortNotConnected, Engines::DSC::BadPortReference)
 
virtual Ports::PortProperties_ptr get_port_properties (const char *port_name) throw (Engines::DSC::PortNotDefined)
 
charinstanceName ()
 CORBA method: return name of the instance, unique in this Container. More...
 
charinterfaceName ()
 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...
 
CORBA::Long getStudyId ()
 CORBA method: Get study Id. 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...
 
virtual void SetOption (const char *, const char *)
 CORBA method: This method is to set an option specific to a certain EngineComponent. More...
 
virtual charGetOption (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::TMPFileDumpPython (CORBA::Object_ptr theStudy, 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 ()
 
virtual chargetObjectInfo (CORBA::Long studyId, const char *entry)
 
virtual chargetVersion ()
 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_iGetContainerPtr ()
 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...
 
virtual bool setStudyId (CORBA::Long studyId)
 C++ method: set study Id. 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...
 
chargraphName ()
 C++ method: – CHECK IF USED –. More...
 
charnodeName ()
 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...
 
virtual void provides_port_changed (const char *provides_port_name, int connection_nbr, const Engines::DSC::Message message)=0
 This method is used by the component when the number of connection on a provides port changes. More...
 
virtual void uses_port_changed (const char *uses_port_name, Engines::DSC::uses_port *new_uses_port, const Engines::DSC::Message message)=0
 This method is used by the component when the number of connection on a uses port changes. More...
 

Static Public Member Functions

static bool isMultiStudy ()
 
static bool isMultiInstance ()
 
static std::string GetDynLibraryName (const char *componentName)
 C++ method: return standard library name built on component name. More...
 
static void writeEvent (const char *request, const std::string &containerName, const char *instance_name, const char *port_name, const char *error, const char *message)
 Write a record in the trace file. 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
 
enum  port_type { uses, provides, none }
 
typedef std::map< std::string,
port_t * > 
ports
 

Protected Attributes

int _studyId
 
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
 
ports my_ports
 
ports::iterator my_ports_it
 

Static Protected Attributes

static bool _isMultiStudy = true
 
static bool _isMultiInstance = false
 

Detailed Description

This class implements the interface Engines::DSC.

The implementation of methods are performed by the class Engines_DSC_interface.

Member Typedef Documentation

typedef std::map<std::string, Salome_file_i*> Engines_Component_i::_t_Salome_file_map
protectedinherited
typedef std::map<std::string, Engines_Component_i::_t_Salome_file_map*> Engines_Component_i::_t_Service_file_map
protectedinherited
typedef std::map<std::string, port_t *> Engines_DSC_interface::ports
protectedinherited

Member Enumeration Documentation

enum Engines_DSC_interface::port_type
protectedinherited
Enumerator
uses 
provides 
none 

Constructor & Destructor Documentation

Engines_DSC_i::Engines_DSC_i ( CORBA::ORB_ptr  orb,
PortableServer::POA_ptr  poa,
PortableServer::ObjectId *  contId,
const char instanceName,
const char interfaceName,
bool  notif = false 
)
Engines_DSC_i::Engines_DSC_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 
)
Engines_DSC_i::~Engines_DSC_i ( )
virtual

Member Function Documentation

virtual void Engines_DSC_i::add_provides_port ( Ports::Port_ptr  ref,
const char provides_port_name,
Ports::PortProperties_ptr  port_prop 
) throw (Engines::DSC::PortAlreadyDefined, Engines::DSC::NilPort, Engines::DSC::BadProperty)
virtual
virtual void Engines_DSC_i::add_uses_port ( const char repository_id,
const char uses_port_name,
Ports::PortProperties_ptr  port_prop 
) throw (Engines::DSC::PortAlreadyDefined, Engines::DSC::BadProperty)
virtual
void Engines_Component_i::CancelThread ( )
inherited

C++ method:

References Engines_Component_i::_CanceledThread.

Referenced by CallCancelThread().

void Engines_Component_i::checkInputFilesToService ( const char service_name)
virtualinherited
void Engines_Component_i::checkOutputFilesToService ( const char service_name)
virtualinherited
void Engines_Component_i::configureSalome_file ( std::string  service_name,
std::string  file_port_name,
Salome_file_i file 
)
virtualinherited

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
fileSalome_file C++ object

Referenced by Engines_Component_i::checkInputFilesToService(), and Engines_Component_i::checkOutputFilesToService().

virtual void Engines_DSC_i::connect_provides_port ( const char provides_port_name) throw (Engines::DSC::PortNotDefined)
virtual
virtual void Engines_DSC_i::connect_uses_port ( const char uses_port_name,
Ports::Port_ptr  provides_port_ref 
) throw (Engines::DSC::PortNotDefined, Engines::DSC::BadPortType, Engines::DSC::NilPort)
virtual
void Engines_Component_i::destroy ( )
inherited

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 Engines_Component_i::_id, Engines_Component_i::_poa, and MESSAGE.

virtual void Engines_DSC_i::disconnect_provides_port ( const char provides_port_name,
const Engines::DSC::Message  message 
) throw (Engines::DSC::PortNotDefined, Engines::DSC::PortNotConnected)
virtual
virtual void Engines_DSC_i::disconnect_uses_port ( const char uses_port_name,
Ports::Port_ptr  provides_port_ref,
const Engines::DSC::Message  message 
) throw (Engines::DSC::PortNotDefined, Engines::DSC::PortNotConnected, Engines::DSC::BadPortReference)
virtual
Engines::TMPFile * Engines_Component_i::DumpPython ( CORBA::Object_ptr  theStudy,
CORBA::Boolean  isPublished,
CORBA::Boolean  isMultiFile,
CORBA::Boolean &  isValidScript 
)
virtualinherited

C++ method: DumpPython default implementation.

void Engines_Component_i::endService ( const char serviceName)
inherited
virtual Ports::PortProperties_ptr Engines_DSC_i::get_port_properties ( const char port_name) throw (Engines::DSC::PortNotDefined)
virtual
virtual Ports::Port_ptr Engines_DSC_i::get_provides_port ( const char provides_port_name,
const CORBA::Boolean  connection_error 
) throw (Engines::DSC::PortNotDefined, Engines::DSC::PortNotConnected)
virtual
virtual Engines::DSC::uses_port* Engines_DSC_i::get_uses_port ( const char uses_port_name) throw (Engines::DSC::PortNotDefined, Engines::DSC::PortNotConnected)
virtual
std::string Engines_Component_i::getContainerName ( )
inherited

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 "_".

Returns
the container name (reformatted)

References Engines_Component_i::_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 ( )
inherited

C++ method: return Container Servant.

References Engines_Component_i::_container, and Engines_Component_i::_poa.

Engines::Container_ptr Engines_Component_i::GetContainerRef ( )
inherited

CORBA method: return CORBA reference of the Container.

References Engines_Component_i::_container.

Referenced by Engines_Component_i::setInputFileToService(), and Engines_Component_i::setOutputFileToService().

std::string Engines_Component_i::GetDynLibraryName ( const char componentName)
staticinherited

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

Referenced by Engines_Container_i::decInstanceCnt(), and Engines_Parallel_Container_i::decInstanceCnt().

PortableServer::ObjectId * Engines_Component_i::getId ( )
inherited

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

References Engines_Component_i::_id.

Referenced by SalomeTestComponentEngine_factory(), and TestMPIComponentEngine_factory().

Engines::Salome_file_ptr Engines_Component_i::getInputFileToService ( const char service_name,
const char Salome_file_name 
)
virtualinherited
virtual char* Engines_Component_i::getObjectInfo ( CORBA::Long  studyId,
const char entry 
)
virtualinherited
char * Engines_Component_i::GetOption ( const char )
virtualinherited

CORBA method: This method is to get value of an option specific to a certain EngineComponent.

Engines::Salome_file_ptr Engines_Component_i::getOutputFileToService ( const char service_name,
const char Salome_file_name 
)
virtualinherited
Engines::FieldsDict * Engines_Component_i::getProperties ( )
inherited

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

(see setProperties)

References Engines_Component_i::_fieldsDict.

CORBA::Long Engines_Component_i::getStudyId ( )
inherited

CORBA method: Get study Id.

Returns
-1: not initialised (Internal Error) 0: multistudy component instance >0: study id associated to this instance

References Engines_Component_i::_studyId.

Referenced by Engines_Container_i::find_or_create_instance(), and Engines_Parallel_Container_i::find_or_create_instance().

char * Engines_Component_i::getVersion ( )
virtualinherited

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.

Note
The version of the component is stored to the study, as a part of general persistence mechanism; once stored, version information in the study cannot be changed.
Returns
string containing component's version, e.g. "1.0"
char * Engines_Component_i::graphName ( )
inherited

C++ method: – CHECK IF USED –.

References Engines_Component_i::_graphName.

Referenced by Engines_Component_i::Names().

virtual bool Engines_Component_i::hasObjectInfo ( )
virtualinherited
char * Engines_Component_i::interfaceName ( )
inherited

CORBA method: return name of the component class.

References Engines_Component_i::_interfaceName.

virtual CORBA::Boolean Engines_DSC_i::is_connected ( const char port_name) throw (Engines::DSC::PortNotDefined)
virtual
static bool Engines_Component_i::isMultiInstance ( )
staticinherited
static bool Engines_Component_i::isMultiStudy ( )
staticinherited
bool Engines_Component_i::Kill_impl ( )
inherited

CORBA method: used in Supervision.

References Engines_Component_i::_ThreadId, and Engines_Component_i::Killer().

bool Engines_Component_i::Killer ( pthread_t  ThreadId,
int  signum 
)
inherited
void Engines_Component_i::Names ( const char graphName,
const char nodeName 
)
inherited

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

References Engines_Component_i::_graphName, Engines_Component_i::_nodeName, Engines_Component_i::graphName(), and Engines_Component_i::nodeName().

char * Engines_Component_i::nodeName ( )
inherited

C++ method: – CHECK IF USED –.

References Engines_Component_i::_nodeName.

Referenced by Engines_Component_i::Names().

void Engines_Component_i::ping ( )
inherited

CORBA method: Test if instance is alive and responds.

References MESSAGE.

virtual void DSC_Callbacks::provides_port_changed ( const char provides_port_name,
int  connection_nbr,
const Engines::DSC::Message  message 
)
pure virtualinherited

This method is used by the component when the number of connection on a provides port changes.

  This information helps the user code to detect operation on its ports.
Parameters
provides_port_namethe name of the provides name that has changed.
connection_nbrthe new number of connection on the provides port.
messagecontains informations about the modification of the port.

Implemented in Superv_Component_i.

void Engines_Component_i::sendMessage ( const char event_type,
const char message 
)
inherited
void Engines_Component_i::setContainerName ( )
inherited

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>".

Returns
the container name (reformatted)

References Engines_Component_i::_container, and Engines_Component_i::_containerName.

Referenced by Engines_Component_i::Engines_Component_i().

void Engines_Component_i::SetCurCpu ( )
inherited
Engines::Salome_file_ptr Engines_Component_i::setInputFileToService ( const char service_name,
const char Salome_file_name 
)
virtualinherited
void Engines_Component_i::SetOption ( const char ,
const char  
)
virtualinherited

CORBA method: This method is to set an option specific to a certain EngineComponent.

Engines::Salome_file_ptr Engines_Component_i::setOutputFileToService ( const char service_name,
const char Salome_file_name 
)
virtualinherited
void Engines_Component_i::setProperties ( const Engines::FieldsDict dico)
inherited

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 Engines_Component_i::_fieldsDict.

CORBA::Boolean Engines_Component_i::setStudyId ( CORBA::Long  studyId)
virtualinherited

C++ method: set study Id.

Parameters
studyId0 if instance is not associated to a study, >0 otherwise (== study id)
Returns
true if the set of study Id is OK must be set once by Container, at instance creation, and cannot be changed after.

References Engines_Component_i::_studyId, and ASSERT.

Referenced by Engines_Parallel_Container_i::createCPPInstance(), Engines_Container_i::createInstance(), and Engines_MPIContainer_i::createMPIInstance().

virtual void DSC_Callbacks::uses_port_changed ( const char uses_port_name,
Engines::DSC::uses_port new_uses_port,
const Engines::DSC::Message  message 
)
pure virtualinherited

This method is used by the component when the number of connection on a uses port changes.

  This information helps the user code to detect operation on its ports.
Parameters
uses_port_namethe name of the uses name that has changed.
new_uses_portthe new sequence representing the uses port.
messagecontains informations about the modification of the port.

Implemented in Superv_Component_i.

void Engines_DSC_interface::writeEvent ( const char request,
const std::string &  containerName,
const char instance_name,
const char port_name,
const char error,
const char message 
)
staticinherited

Write a record in the trace file.

Parameters
requestthe name of the request executed
containerNamethe name of the container where the request is executed
instance_namethe name of the component where the request is executed
port_namethe name of the port that is concerned
errorif an error has occured, a string that identifies the error
messageinformations about error or about the request

References initTrace().

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(), GenericPort< DataManipulator, COUPLING_POLICY >::get(), and GenericPort< DataManipulator, COUPLING_POLICY >::next().

Field Documentation

std::string Engines_Component_i::_containerName
protectedinherited
PortableServer::ObjectId* Engines_Component_i::_contId
protectedinherited
std::map<std::string,CORBA::Any> Engines_Component_i::_fieldsDict
protectedinherited
std::string Engines_Component_i::_graphName
protectedinherited
bool Engines_Component_i::_isMultiInstance = false
staticprotectedinherited
bool Engines_Component_i::_isMultiStudy = true
staticprotectedinherited
RegistryConnexion* Engines_Component_i::_myConnexionToRegistry
protectedinherited
std::string Engines_Component_i::_nodeName
protectedinherited
CORBA::ORB_var Engines_Component_i::_orb
protectedinherited
std::string Engines_Component_i::_serviceName
protectedinherited
int Engines_Component_i::_studyId
protectedinherited
ports Engines_DSC_interface::my_ports
protectedinherited
ports::iterator Engines_DSC_interface::my_ports_it
protectedinherited