System Interface CATICommunicator
Usage: an implementation of this interface is supplied and you must use it as is. You should not reimplement it.
interface CATICommunicator
Interface to represent the logical connexion to the backbone bus.
Role: This interface provides all the main services to exchange
messages with the backbone bus:
- Gets a connexion to the bus
- Declares itself on the bus
- Sends a message on the bus
- Receives a message from other applications connected to the bus (via the bus)
- Declares the messages the process may handle
- Associates handlers to these messages
- Removes these handlers
- Disconnects from the bus
Example of code:
- Get a connexion to the backbone bus with the global method
- Declare to be a backbone application with the
method
To receive message an application should:
- Declare to be interested in receiving messages thanks the
method
- Declare an handler for message class it want to receive thanks
to the
method
To send message an application should:
- Disconnect to the backbone bus thanks the
method
- See also:
- , , , , ,
Method Index
- o
AssociateHandler(CATApplicationClass,CATMessageClass,CATIMessageReceiver*)
- Declares an handler for a backbone message class.
- o
Declare(CATApplicationClass,CATApplicationType)
- Declares an application as a backbone application.
- o
DeclareEventManaged(CATMessageClass)
- Declares a backbone message class the application is interested with to receive.
- o
Disconnect()
- Logical disconnection from the backbone bus.
- o
GetLastErrorId(int*)
- Gets the last error.
- o
GetRequestAnswer(CATICommMsg*,CATICommMsg**,int)
- Permits to wait for the answer of a synchronous backbone message.
- o
RemoveHandler(CATApplicationClass,CATMessageClass,CATIMessageReceiver*)
- Removes a backbone message handler.
- o
SendRequest(CATApplicationClass,CATICommMsg*)
- Emits a backbone message on the backbone bus.
Methods
o AssociateHandler
public virtual AssociateHandler( | | iAppClassReceiver, |
| | iMsgClass, |
| | iReceiver) |
-
Declares an handler for a backbone message class.
Role: Permits to associate a handler object to any arriving message
of class iMsgClass sent for the iAppClassReceiver application.
If a message of class iMsgClass incomes to the application iAppClassReceiver,
iReceiver will be called on the
method to process the message.
- Parameters:
-
- iAppClassReceiver
- The identificator under which the receiver application is known on
the backbone bus.
- iMsgClass
- The message class of the future incoming messages to which we want to
associate a handler
- iReceiver
- This object will be called in the future when a message of type
iMsgClass sent to the application iAppClassReceiver will arrive on the receiver application
o Declare
public virtual Declare( | | iAppClass, |
| | iAppType | =CATStandardApp) |
-
Declares an application as a backbone application.
Role: This service should be called only once for a given application during
a connexion.
- Parameters:
-
- iAppClass
- The identificator under which the application is known on
the backbone bus.
- iAppType
- Legal Values:CATStandardApp
o DeclareEventManaged
public virtual DeclareEventManaged( | | iMsgClass) |
-
Declares a backbone message class the application is interested with to receive.
Role: Permits an application to declare that it is interested with receiving
message of class iMsgClass
- Parameters:
-
- iMsgClass
- iMsgClass is the class name of the message class the application wishes to receive
o Disconnect
public virtual Disconnect( | ) |
-
Logical disconnection from the backbone bus.
Role: This method permits the disconnection from the bus. It's the end of
the connexion done by the
global method.
o GetLastErrorId
public virtual GetLastErrorId( | | oLastError) |
-
Gets the last error.
Role: This method permits to get the last error.
- Parameters:
-
- oLastError
- Legal Values:
- CATBBErr_PortNotFound : Unable to contact given port
- CATBBErr_UnableToGetPort : Unable to declare on given port
- CATBBErr_AnswerPortAcceptFailed : failed because invalid answer port
- CATBBErr_ErrorWaitingForPort : error during WaitForPort operation
- CATBBErr_InitSendSocketInvalid : Try to send a message on a close or invalid socket
during the declaration phase,
contact to bus probably lost
- CATBBErr_SendSocketInvalid : Try to send a message on a close or invalid socket,
contact to bus probably lost
- CATBBErr_RcvSocketInvalid : Try to receive a message from a close or invalid socket,
contact to bus probably lost
- CATBBErr_MessageClassNotFound : message class not found
- CATBBErr_DataStreamingFailure : error during stream operation
- CATBBErr_DataUntreamingFailure : error during unstream operation
- CATBBErr_MustImplementCATIStreamMsg : message object doesn't implements CATIStreamMsg
- CATBBErr_MustNeedAnAnswer : message object doesn't need answers
- CATBBErr_UnableToInstanciateMsg : unable to instanciate message object
- CATBBErr_ReentranceConditionFound :
- CATBBErr_TimeoutOccurred :
- CATBBErr_TargetApplicationNotPresent :
o GetRequestAnswer
public virtual GetRequestAnswer( | | iMsg, |
| | oAnswer, |
| | timeout | =-1) |
-
Permits to wait for the answer of a synchronous backbone message.
Role: This method permits to wait for the answer of a given
backbone message.
We advise user to avoid as much as possible synchronous messages and the use
of GetRequestAnswer.
Using synchronous messages and waiting to the answers has the following
disadvantages :
- costs more resources
- may generate interblocking conditions ( two applications waiting for each other)
- Parameters:
-
- iMsg
- synchronous backbone request needing a immediate answer
- oAnswer
- Answer to the iMsg request
o RemoveHandler
public virtual RemoveHandler( | | iAppClass, |
| | iMsgClass, |
| | iReceiver) |
-
Removes a backbone message handler.
Role: This method permits to remove the handler iReceiver of the message
identified by its target application iAppClass and its class iMsgClass.
This method cancels effects of the corresponding
method.
- Parameters:
-
- iAppClass
- The identificator under which the application is known on the backbone bus
- iMsgClass
- The message class to which iReceiver is associated
- iReceiver
- The object which handles the message
o SendRequest
public virtual SendRequest( | | iAppClass, |
| | iMsg) |
-
Emits a backbone message on the backbone bus.
Role: This method permits to send messages to other backbone
applications via the backbone bus.
- Parameters:
-
- iAppClass
- Target application of the message
- iMsg
- Backbone message to emit
This object is included in the file: CATICommunicator.h
If needed, your Imakefile.mk should include the module: CATSysCommunication
Copyright © 1999-2015, Dassault Systèmes. All rights reserved.