C++ TargetRTS
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
RTSymmetricSignal Struct Reference

Provides the combined API of both RTOutSignal and RTInSignal for symmetric protocol events defined as an incoming and an outgoing event with the same name. More...

#include <RTSymmetricSignal.h>

Public Member Functions

int purge (void)
 Remove from the defer queue all messages that match the receiver port and the signal id of the protocol event.
 
int purgeAt (int index)
 Remove from the defer queue all messages that match the receiver port and the signal id of the protocol event.
 
int recall (int front=0)
 Recall a message from the defer queue and insert it in the controller's message queue (either before or after other queued messages).
 
int recallAt (int index, int front=0)
 Recall a message from the defer queue and insert it in the controller's message queue (either before or after other queued messages).
 
int recallAll (int front=0)
 Recall one or many messages from the defer queue and insert them in the controller's message queue (either before or after other queued messages).
 
int recallAllAt (int index, int front=0)
 Recall one or many messages from the defer queue and insert them in the controller's message queue (either before or after other queued messages).
 
int invoke (RTMessage *replyBuffers)
 Invoke a message of the specified protocol event and on the specified port (optionally passing a specified data object with the invoke message).
 
int invokeAt (int index, RTMessage *replyBuffer)
 Invoke a message of the specified protocol event and on the specified port (optionally passing a specified data object with the invoke message).
 
int invoke ()
 Invoke a message of the specified protocol event and on the specified port (optionally passing a specified data object with the invoke message).
 
int invokeAt (int index)
 Invoke a message of the specified protocol event and on the specified port (optionally passing a specified data object with the invoke message).
 
int reply (void)
 Make a reply to respond to an invoke.
 
int send (int priority=General)
 Send a message of the specified protocol event and on the specified port (optionally passing a specified data object with the sent message).
 
int sendAt (int index, int priority=General)
 Send a message of the specified protocol event and on the specified port (optionally passing a specified data object with the sent message).
 
 RTSymmetricSignal (RTProtocol *, int signal_in, int signal_out)
 

Public Attributes

RTProtocol_port
 The port to which the message should be sent.
 
int _in_signal
 The signal id of the incoming protocol event for the received message.
 
int _out_signal
 The signal id of the outgoing protocol event for the message to send.
 

Detailed Description

Provides the combined API of both RTOutSignal and RTInSignal for symmetric protocol events defined as an incoming and an outgoing event with the same name.

Member Function Documentation

◆ invoke() [1/2]

int RTSymmetricSignal::invoke ( )

Invoke a message of the specified protocol event and on the specified port (optionally passing a specified data object with the invoke message).

No reply data can be passed back to the caller and the callee does not have to make an explicit reply (it is implicitly made when completing the invoke).

Returns
1 if the invoke was successful, 0 otherwise.

◆ invoke() [2/2]

int RTSymmetricSignal::invoke ( RTMessage replyBuffers)

Invoke a message of the specified protocol event and on the specified port (optionally passing a specified data object with the invoke message).

Parameters
replyBuffersA caller-supplied message object that stores the reply message(s) resulting from the invoke. The caller is responsible for allocating and deleting the message(s) when they are no longer required. To verify that a returned message is valid call RTMessage::isValid() once the invoke returns. The callee must make an explicit reply call even if no data needs to be passed back to the caller.
Returns
1 if the invoke was successful, 0 otherwise.

◆ invokeAt() [1/2]

int RTSymmetricSignal::invokeAt ( int  index)

Invoke a message of the specified protocol event and on the specified port (optionally passing a specified data object with the invoke message).

The message is invoked at the specified port index. No reply data can be passed back to the caller and the callee does not have to make an explicit reply (it is implicitly made when completing the invoke).

Parameters
[in]indexPort index (0-based).
Returns
1 if the invoke was successful, 0 otherwise.

◆ invokeAt() [2/2]

int RTSymmetricSignal::invokeAt ( int  index,
RTMessage replyBuffer 
)

Invoke a message of the specified protocol event and on the specified port (optionally passing a specified data object with the invoke message).

The message is invoked at the specified port index.

Parameters
[in]indexPort index (0-based).
replyBufferA caller-supplied message object that stores the reply message(s) resulting from the invoke. The caller is responsible for allocating and deleting the message(s) when they are no longer required. To verify that a returned message is valid call RTMessage::isValid() once the invoke returns. The callee must make an explicit reply call even if no data needs to be passed back to the caller.
Returns
1 if the invoke was successful, 0 otherwise.

◆ purge()

int RTSymmetricSignal::purge ( void  )

Remove from the defer queue all messages that match the receiver port and the signal id of the protocol event.

If the receiver port is replicated messages will be deleted from the defer queue regardless of the port index on which they were received.

Returns
The number of messages deleted from the defer queue.

◆ purgeAt()

int RTSymmetricSignal::purgeAt ( int  index)

Remove from the defer queue all messages that match the receiver port and the signal id of the protocol event.

Only the messages that were received on a certain port index will be deleted from the defer queue.

Parameters
[in]indexPort index (0-based)
Returns
The number of messages deleted from the defer queue.

◆ recall()

int RTSymmetricSignal::recall ( int  front = 0)

Recall a message from the defer queue and insert it in the controller's message queue (either before or after other queued messages).

At most one message will be recalled and it must match the receiver port and the signal id of the protocol event (however, it doesn't matter on which port index it was received).

Parameters
[in]frontIf 0 the recalled message will be inserted at the back of the message queue, otherwise it will be inserted at the front of the message queue.
Returns
The number of messages recalled from the defer queue (i.e. either 1 or 0).

◆ recallAll()

int RTSymmetricSignal::recallAll ( int  front = 0)

Recall one or many messages from the defer queue and insert them in the controller's message queue (either before or after other queued messages).

All messages will be recalled that match the receiver port and the signal id of the protocol event (however, it doesn't matter on which port index they were received).

Parameters
[in]frontIf 0 the recalled messages will be inserted at the back of the message queue, otherwise they will be inserted at the front of the message queue.
Returns
The number of messages recalled from the defer queue.

◆ recallAllAt()

int RTSymmetricSignal::recallAllAt ( int  index,
int  front = 0 
)

Recall one or many messages from the defer queue and insert them in the controller's message queue (either before or after other queued messages).

All messages will be recalled that match the receiver port and the signal id of the protocol event. They must also have been received on a certain port index.

Parameters
[in]indexPort index (0-based)
[in]frontIf 0 the recalled messages will be inserted at the back of the message queue, otherwise they will be inserted at the front of the message queue.
Returns
The number of messages recalled from the defer queue.

◆ recallAt()

int RTSymmetricSignal::recallAt ( int  index,
int  front = 0 
)

Recall a message from the defer queue and insert it in the controller's message queue (either before or after other queued messages).

At most one message will be recalled and it must match the receiver port and the signal id of the protocol event. It must also have been received on a certain port index.

Parameters
[in]indexPort index (0-based)
[in]frontIf 0 the recalled message will be inserted at the back of the message queue, otherwise it will be inserted at the front of the message queue.
Returns
The number of messages recalled from the defer queue (i.e. either 1 or 0).

◆ reply()

int RTSymmetricSignal::reply ( void  )

Make a reply to respond to an invoke.

The reply message is of the specified protocol event and is made on the specified port (optionally passing a specified data object with the reply message).

Returns
1 if the reply was successful, 0 otherwise.

◆ send()

int RTSymmetricSignal::send ( int  priority = General)

Send a message of the specified protocol event and on the specified port (optionally passing a specified data object with the sent message).

Parameters
priorityThe priority at which the message should be sent. A message priority is interpreted as its relative importance with respect to all other unprocessed messages on a thread. The priority evaluates to one of the defined global priority values.
Returns
1 if the message was successfully sent, 0 otherwise.

◆ sendAt()

int RTSymmetricSignal::sendAt ( int  index,
int  priority = General 
)

Send a message of the specified protocol event and on the specified port (optionally passing a specified data object with the sent message).

The message is sent at the specified port index.

Parameters
[in]indexPort index (0-based).
priorityThe priority at which the message should be sent. A message priority is interpreted as its relative importance with respect to all other unprocessed messages on a thread. The priority evaluates to one of the defined global priority values.
Returns
1 if the message was successfully sent, 0 otherwise.

The documentation for this struct was generated from the following files: