Version: 8.3.0
Engines::DSC Interface Reference

Interface of a DSC component. More...

import "DSC_Engines.idl";

Inheritance diagram for Engines::DSC:

Data Structures

exception  BadPortReference
 Port's reference is not the right reference. More...
 
exception  BadPortType
 This exception is raised if the type of the provides port is bad. More...
 
exception  BadProperty
 Object property is not good for the port. More...
 
exception  NilPort
 Port's reference is Nil ! More...
 
exception  PortAlreadyDefined
 This exception is raised if you try to add a port with the same name than a previous defined port. More...
 
exception  PortNotConnected
 This exception is raised when you try to use a port that is not connected. More...
 
exception  PortNotDefined
 This exception is raised when a port is used before it is added to the component. More...
 

Public Types

enum  Message { AddingConnection, RemovingConnection, ApplicationError }
 This enumeration is used when the connection of a port (uses or provides) is changed. More...
 
typedef sequence< Ports::Portuses_port
 a uses port More...
 

Public Member Functions

void add_provides_port (in Ports::Port ref, in string provides_port_name, in Ports::PortProperties port_prop) raises (PortAlreadyDefined, NilPort, BadProperty)
 This operation adds a provides port to the component. More...
 
void add_uses_port (in string repository_id, in string uses_port_name, in Ports::PortProperties port_prop) raises (PortAlreadyDefined, BadProperty)
 This operation adds a uses port to the component. More...
 
Ports::Port get_provides_port (in string provides_port_name, in boolean connection_error) raises (PortNotDefined, PortNotConnected, BadPortType)
 Get a provides port of the component. More...
 
uses_port get_uses_port (in string uses_port_name) raises (PortNotDefined, PortNotConnected, BadPortType)
 Get a uses port of the component. More...
 
void connect_provides_port (in string provides_port_name) raises (PortNotDefined)
 Connect a provides port with a uses port. More...
 
void connect_uses_port (in string uses_port_name, in Ports::Port provides_port_ref) raises (PortNotDefined, BadPortType, NilPort)
 Connect a uses port with a provides port. More...
 
boolean is_connected (in string port_name) raises (PortNotDefined)
 Check if a port is connected. More...
 
void disconnect_provides_port (in string provides_port_name, in Engines::DSC::Message message) raises (PortNotDefined, PortNotConnected)
 Disconnect a uses port from a provides port. More...
 
void disconnect_uses_port (in string uses_port_name, in Ports::Port provides_port_ref, in Engines::DSC::Message message) raises (PortNotDefined, PortNotConnected, BadPortReference)
 Disconnect a provides port from a uses port. More...
 
Ports::PortProperties get_port_properties (in string port_name) raises (PortNotDefined)
 Get port's property object. More...
 
void ping ()
 Determines whether the server has already been loaded or not. More...
 
long getStudyId ()
 Get study associated to component instance. More...
 
void destroy ()
 Remove component instance from container. More...
 
Container GetContainerRef ()
 Returns the container that the Component refers to. More...
 
void setProperties (in FieldsDict dico)
 Set component instance properties. More...
 
FieldsDict getProperties ()
 Get component instance properties. More...
 
void SetOption (in string optionName, in string value)
 Set an option value. More...
 
string GetOption (in string optionName)
 Return an option value. More...
 
void Names (in string aGraphName, in string aNodeName)
 Set name of a node in a graph (for SUPERVISOR use) More...
 
boolean Kill_impl ()
 Kill the component (if you can) More...
 
boolean Stop_impl ()
 Stop the component (if you can) More...
 
boolean Suspend_impl ()
 Suspend the component. More...
 
boolean Resume_impl ()
 Resume the component. More...
 
long CpuUsed_impl ()
 Get the cpu used. More...
 
TMPFile DumpPython (in Object theStudy, in boolean isPublished, in boolean isMultiFile, out boolean isValidScript)
 Get a python dump. More...
 
Engines::Salome_file getInputFileToService (in string service_name, in string Salome_file_name) raises (SALOME::SALOME_Exception)
 Returns a CORBA Ref of a input Salome_file managed by a service. More...
 
void checkInputFilesToService (in string service_name) raises (SALOME::SALOME_Exception)
 Check service input files (transfer them if needed) More...
 
Engines::Salome_file setInputFileToService (in string service_name, in string Salome_file_name) raises (SALOME::SALOME_Exception)
 This method adds a input Salome_file to a service of the component. More...
 
Engines::Salome_file getOutputFileToService (in string service_name, in string Salome_file_name) raises (SALOME::SALOME_Exception)
 Returns a CORBA Ref of a output Salome_file managed by a service. More...
 
void checkOutputFilesToService (in string service_name) raises (SALOME::SALOME_Exception)
 Check service output files (transfer them if needed) More...
 
Engines::Salome_file setOutputFileToService (in string service_name, in string Salome_file_name) raises (SALOME::SALOME_Exception)
 This method adds an output Salome_file to a service of the component. More...
 
boolean hasObjectInfo ()
 Indicate if the component instance provides custom information about its objects. More...
 
string getObjectInfo (in long studyId, in string entry)
 Get custom information about the given object. More...
 
string getVersion ()
 Get version of the component. More...
 

Data Fields

readonly attribute string instanceName
 The name of the instance of the Component. More...
 
readonly attribute string interfaceName
 The name of the interface of the Component. More...
 

Detailed Description

Interface of a DSC component.

This interface defines the operations needed to add a component model with dynamic port declaration to the SALOME object model. A component is a black box that interacts with other components only by his ports. A port represents a connection point for the component. In this model, a port is a CORBA interface, so a CORBA object.

There is two ways for a component to interact with a port type :

  • It implements the port : it means "the component provides an implementation of the interface of the port". We design this kind of port as "provides ports". It provides an interface to other components.
  • It needs to use an object that provides the port interface. We say that the component uses this port type. It is represented by a "uses" port. A uses port can be connected with a provides port of the same interface type. When the connection is done, a component can use the "uses port" to use the interface provided by the "provides port".

The interface DSC implements the component interface that containes the operations that are needed to manage declarations into a component and connections between ports.

These operations are logicaly divided in two parts :

  • First part permits to add an get ports of a component.
  • Second part permits to connect/disconnect ports.

Member Typedef Documentation

a uses port

This sequence is a uses port. It's a sequence since a uses port can be connected with x provides port. Sometimes this kind of uses port is called multiple port. At this programming level, the user has to deal with the sequence. In the DSC_user layer, the user only deals with one pointer.

Member Enumeration Documentation

This enumeration is used when the connection of a port (uses or provides) is changed.

This information is for the component's user code.

Enumerator
AddingConnection 
RemovingConnection 
ApplicationError 

Member Function Documentation

void Engines::DSC::add_provides_port ( in Ports::Port  ref,
in string  provides_port_name,
in Ports::PortProperties  port_prop 
) raises (PortAlreadyDefined, NilPort, BadProperty)

This operation adds a provides port to the component.

Parameters
refport's Corba reference.
provides_port_nameport's name.
port_propport's property object.
Exceptions
PortAlreadyDefined
NilPort
BadProperty
Note
Notice that the name of the port is unique on a component. So if there is a uses port that has the same name, the PortAlreadyDefined exception will be throw. Also notice that each port as an object property that is associated with.
void Engines::DSC::add_uses_port ( in string  repository_id,
in string  uses_port_name,
in Ports::PortProperties  port_prop 
) raises (PortAlreadyDefined, BadProperty)

This operation adds a uses port to the component.

Parameters
repository_idport's Corba repository id. Eg : IDL:toto.tata/MODULE/INTERFACE_NAME:1.0
uses_port_nameport's name.
port_propport's property object.
Exceptions
PortAlreadyDefined
BadProperty
Note
Notice that the name of the port is unique on the component. So if there is a provides port that has the same name, the PortAlreadyDefined exception will be throw. Also notice that each port as an object property that is associated with.
void Engines::EngineComponent::checkInputFilesToService ( in string  service_name) raises (SALOME::SALOME_Exception)
inherited

Check service input files (transfer them if needed)

This method is used before the activation of the service. It calls recvFiles() on all the input Salome_file files of the service.

Before each recvFiles(), it uses the callback method named configureSalome_file. This method allows the user to configure the files managed by the Salome_file.

By default, there is no files managed when a Salome_file is created, but the supervisor set some files managed by the Salome_file from the information contained into the schema file.

Parameters
service_nameservice's name.
Exceptions
containsinformations about files that are not in a good state.
void Engines::EngineComponent::checkOutputFilesToService ( in string  service_name) raises (SALOME::SALOME_Exception)
inherited

Check service output files (transfer them if needed)

This method is used at the end of the service. It calls recvFiles() on all the output Salome_file files of the service.

Before each recvFiles(), it uses the callback method named configureSalome_file. This method allows the user to configure the files managed by the Salome_file.

By default, there is no files managed when a Salome_file is created, but the supervisor set some files managed by the Salome_file from the information contained into the schema file.

Parameters
service_nameservice's name.
Exceptions
containsinformations about files that are not in a good state.
void Engines::DSC::connect_provides_port ( in string  provides_port_name) raises (PortNotDefined)

Connect a provides port with a uses port.

Parameters
provides_port_nameprovides port's name.
Exceptions
PortNotDefined
Note
Notice that the provides doesn't uses port names or component reference.
void Engines::DSC::connect_uses_port ( in string  uses_port_name,
in Ports::Port  provides_port_ref 
) raises (PortNotDefined, BadPortType, NilPort)

Connect a uses port with a provides port.

Parameters
uses_port_nameuses port's name.
provides_port_refprovides port's Corba reference.
Exceptions
PortNotDefined
BadPortType
NilPort
long Engines::EngineComponent::CpuUsed_impl ( )
inherited

Get the cpu used.

Returns the Cpu used

void Engines::EngineComponent::destroy ( )
inherited

Remove component instance from container.

Deactivates the Component. – TO BE USED BY CONTAINER ONLY (Container housekeeping) – use remove_impl from Container instead !

void Engines::DSC::disconnect_provides_port ( in string  provides_port_name,
in Engines::DSC::Message  message 
) raises (PortNotDefined, PortNotConnected)

Disconnect a uses port from a provides port.

Parameters
provides_port_nameprovides port's name.
messagestate associated with the disconnection.
Exceptions
PortNotDefined
PortNotConnected
void Engines::DSC::disconnect_uses_port ( in string  uses_port_name,
in Ports::Port  provides_port_ref,
in Engines::DSC::Message  message 
) raises (PortNotDefined, PortNotConnected, BadPortReference)

Disconnect a provides port from a uses port.

Parameters
uses_port_nameuses port's name.
provides_port_refCORBA reference of the provides port.
messagestate associated with the disconnection.
Exceptions
PortNotDefined
PortNotConnected
BadPortReference
TMPFile Engines::EngineComponent::DumpPython ( in Object  theStudy,
in boolean  isPublished,
in boolean  isMultiFile,
out boolean  isValidScript 
)
inherited

Get a python dump.

Returns a python script, which is being played back reproduces the data model of component

Ports::PortProperties Engines::DSC::get_port_properties ( in string  port_name) raises (PortNotDefined)

Get port's property object.

Parameters
port_nameport's name.
Returns
properties object's CORBA reference.
Exceptions
PortNotDefined
Ports::Port Engines::DSC::get_provides_port ( in string  provides_port_name,
in boolean  connection_error 
) raises (PortNotDefined, PortNotConnected, BadPortType)

Get a provides port of the component.

It can be used by the framework or the component himself.

If it's the framework that wants the port, the reference has to be gived even if the port is not connected (boolean connection_error to false). Contrary, if it's the component that wants the port, the port is given in most of cases only if it is connected (boolean connection_error to true). Notice that you can choose the behaviour that you want.

Parameters
provides_port_nameport's name.
connection_errortrue if you want to wait that the port is connected with an another port.
Returns
port's Corba reference.
Exceptions
PortNotDefined
PortNotConnected
BadPortType
uses_port Engines::DSC::get_uses_port ( in string  uses_port_name) raises (PortNotDefined, PortNotConnected, BadPortType)

Get a uses port of the component.

It can be used by the framework or the component himself. Actually, only the user layer of the component will use this operation. A uses port could be obtained if and only if the uses port is connected. The sequence contains all the connections since a uses port can have multiple connections.

There is a system of callbacks to prevent the user code that there is a new (or a deletion) of a connection (see DSC_Callbacks class).

Parameters
uses_port_nameport's name.
Returns
uses port's sequence.
Exceptions
PortNotDefined
PortNotConnected
BadPortType
See Also
DSC_Callbacks
Container Engines::EngineComponent::GetContainerRef ( )
inherited

Returns the container that the Component refers to.

Engines::Salome_file Engines::EngineComponent::getInputFileToService ( in string  service_name,
in string  Salome_file_name 
) raises (SALOME::SALOME_Exception)
inherited

Returns a CORBA Ref of a input Salome_file managed by a service.

Parameters
service_nameservice's name.
file_namename of the requested file.
Returns
CORBA Ref of the requested file.
Exceptions
containsinformations of what if the component cannot sends the file's reference.
string Engines::EngineComponent::getObjectInfo ( in long  studyId,
in string  entry 
)
inherited

Get custom information about the given object.

This method is used to get the custom information about the given object. Should be redefined in the certain component in case of this component provides such information. It is worth using this method only if hasObjectInfo() method returns true.

Parameters
entryobject's entry.
studyIdstudy id
Returns
an information about the given object.
string Engines::EngineComponent::GetOption ( in string  optionName)
inherited

Return an option value.

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

Engines::Salome_file Engines::EngineComponent::getOutputFileToService ( in string  service_name,
in string  Salome_file_name 
) raises (SALOME::SALOME_Exception)
inherited

Returns a CORBA Ref of a output Salome_file managed by a service.

Parameters
service_nameservice's name.
file_namename of the requested file.
Returns
CORBA Ref of the requested file.
Exceptions
containsinformations of what if the component cannot sends the file's reference.
FieldsDict Engines::EngineComponent::getProperties ( )
inherited

Get component instance properties.

returns a previously stored map (key=string,value=any) as a sequence. See setProperties(in FieldsDict dico).

long Engines::EngineComponent::getStudyId ( )
inherited

Get study associated to component instance.

get study associated to component instance

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

Get version of the component.

This method is supposed to be implemented in all derived classes; default implementation returns "unknown" 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"
boolean Engines::EngineComponent::hasObjectInfo ( )
inherited

Indicate if the component instance provides custom information about its objects.

Returns true if the component provides custom information about its objects, false otherwise. Should be redefined in the certain component to return true in case of this component provides such information.

boolean Engines::DSC::is_connected ( in string  port_name) raises (PortNotDefined)

Check if a port is connected.

You can test a uses port or a provides port.

Parameters
port_nameport's name.
Returns
true if the uses port is connected.
Exceptions
PortNotDefined
boolean Engines::EngineComponent::Kill_impl ( )
inherited

Kill the component (if you can)

Returns True if the Component has been killed.

void Engines::EngineComponent::Names ( in string  aGraphName,
in string  aNodeName 
)
inherited

Set name of a node in a graph (for SUPERVISOR use)

This method is used by the SUPERVISOR component. It sets the names of the graph and of the node.

Parameters
aGraphNameName of graph
aNodeNameName of node
void Engines::EngineComponent::ping ( )
inherited

Determines whether the server has already been loaded or not.

boolean Engines::EngineComponent::Resume_impl ( )
inherited

Resume the component.

Returns True if the activity of the Component has been resumed.

Engines::Salome_file Engines::EngineComponent::setInputFileToService ( in string  service_name,
in string  Salome_file_name 
) raises (SALOME::SALOME_Exception)
inherited

This method adds a input Salome_file to a service of the component.

Parameters
service_nameservice's name.
Salome_file_namename of the Salome_file
Returns
a reference of the Salome_file
Exceptions
raisesan exception if there is already a Salome_file with this name for the service.
void Engines::EngineComponent::SetOption ( in string  optionName,
in string  value 
)
inherited

Set an option value.

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

Engines::Salome_file Engines::EngineComponent::setOutputFileToService ( in string  service_name,
in string  Salome_file_name 
) raises (SALOME::SALOME_Exception)
inherited

This method adds an output Salome_file to a service of the component.

Parameters
service_nameservice's name.
Salome_file_namename of the Salome_file
Returns
a reference of the Salome_file
Exceptions
raisesan exception if there is already a Salome_file with this name for the service.
void Engines::EngineComponent::setProperties ( in FieldsDict  dico)
inherited

Set component instance properties.

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.

boolean Engines::EngineComponent::Stop_impl ( )
inherited

Stop the component (if you can)

Returns True if the activity of the Component has been stopped. (It's action can't be resumed)

boolean Engines::EngineComponent::Suspend_impl ( )
inherited

Suspend the component.

Returns True if the activity of the Component has been suspended. (It's action can be resumed)

Field Documentation

readonly attribute string Engines::EngineComponent::instanceName
inherited

The name of the instance of the Component.

readonly attribute string Engines::EngineComponent::interfaceName
inherited

The name of the interface of the Component.