Previous | Contents | Index |
RTRData is the abstract base class for all data classes.
Construction
Method | Description |
---|---|
RTRData() | Default constructor |
RTRData() | Default destructor |
Operations
Method | Description |
---|---|
Dispatch() | Basic method. |
GetActualBufferLength() | Return the message buffer length. |
GetLogicalBufferLength() | Return the logical buffer length. |
IsApplicationEvent() | Determine if this object contains application-generated data. |
IsApplicationMessage() | Determine if this object contains application-generated message. |
IsEvent() | Determine if this object contains an RTR or application-generated event. |
IsMessage() | Determine if this object contains an RTR or application-generated message. |
IsRTREvent() | Determine if this object contains RTR-generated data. |
IsRTRMessage() | Determine if this object contains RTR-generated message. |
virtual rtr_status_t Dispatch() = 0;
rtr_status_t Interpret value for the success or failure of this call. RTR_STS_OK is the normal successful completion.
None
This is a pure virtual member function. RTRData does not supply an implementation for Dispatch and therefore cannot be instantiated. All classes that derive from RTRData must implement their own version of Dispatch, with the functionality based on their needs.
rtr_msglen_t GetActualBufferLength ();
rtr_msglen_t The message buffer length.
None
The method returns the message buffer length.
GetActualBufferLength ();
rtr_msglen_t GetLogicalBufferLength();
rtr_msglen_t Return the logical buffer length.
None
Call this method for the logical buffer length.
GetLogicalBufferLength();
bool IsApplicationEvent ();
bool A true or false return value.
None
If the RTRData object contains an event sent by the application, this function returns TRUE. Otherwise it returns FALSE.
sStatus = Receive(&pResult); print_status_on_failure(sStatus); if ( true == pResult->IsApplicationEvent();)
bool IsApplicationMessage();
bool A true or false return value.
None
If the RTRData object contains a message sent by the application, this function returns TRUE. Otherwise it returns FALSE.
sStatus = Receive(&pResult); print_status_on_failure(sStatus); if ( true == pResult->IsApplicationMessage();)
bool IsEvent();
bool A true or false return value.
None
If the RTRData object contains an event, generated by either RTR or an application, this function returns TRUE. Otherwise it returns FALSE.
if (IsEvent();) { rtr_evtnum_t enEvent; sStatus = GetEventNumber(enEvent); }
bool IsMessage();
bool A true or false return value.
None
If the RTRData object contains a message, generated by either RTR or an application, this function returns TRUE. Otherwise it returns FALSE.
// Look for a status for this transaction. RTRData *pTransactionData = new RTRData(); sStatus = GetTransaction()->Receive(pTransactionData); // Determine if we have a message or an event if (false == pTransactionData->IsMessage();) { pTransactionData->Dispatch(); }
bool IsRTREvent();
bool A true or false return value.
None
If the RTRData object contains an event sent by the application, this function returns TRUE. Otherwise it returns FALSE.
sStatus = Receive(&pResult); print_status_on_failure(sStatus); if ( true == pResult->IsRTREvent();)
bool IsRTRMessage();
bool A true or false return value.
None
If the RTRData object contains a message sent by the application, this function returns TRUE. Otherwise it returns FALSE.
sStatus = Receive(&pResult); print_status_on_failure(sStatus); if ( true == pResult->IsRTRMessage();)
RTRData(); virtual ~RTRData();
None
This constructor is a pure virtual function and requires an associated higher-level data object (for example, RTRApplicationMessage). The default constructor should be used by applications when receiving data from a call to Receive that does not intend to handle allocation and de-allocation of memory for the call. By using this form of the constructor, the application requests that RTR allocate enough memory to receive the data.
Construction
Method | Description |
---|---|
RTREvent() | Default constructor |
~RTREvent() | Default destructor |
Operations
Method | Description |
---|---|
Dispatch() | Basic method. |
GetEventData( rtr_msgbuf_t ) | Retrieve the RTR data associated with this RTREvent object. |
GetEventDataLength(); | Retrieve the actual length of the data associated for this RTREvent object. |
GetEventNumber( rtr_evtnum_t ) | Retreive the RTR event associated with the data in this RTREvent object. |
rtr_status_t Dispatch();
rtr_status_t Interpret value for the success or failure of this call.
Status | Message |
---|---|
RTR_STS_OK | Normal successful completion |
RTR_STS_TCDELETED | The application has deleted the transaction controller. |
RTR_STS_EVENT | The data object does not contain an event. |
RTR_STS_NOEVENTDATA | There is no event data associated with the event. |
RTR_STS_MESSAGE | The data object does not contain a message. |
RTR_STS_HANDLERDELETED | The application has deleted the handler. |
RTR_STS_NOHANDLRREGSTRD | The application has not registered a handler |
None
This member function must be overridden by the RTR application. When called the data contained within the object is processed. Processing the data may include performing some application specific logic and/or dispatching to a handler.
sStatus = pOrderEvent->Dispatch();
rtr_status_t GetEventData( rtr_msgbuf_t &evEventData );
rtr_status_t Interpret value for the success or failure of this call.
Status | Message |
---|---|
RTR_STS_OK | Normal successful completion |
RTR_STS_INVARGPTR | |
RTR_STS_NOEVENTDATA | There is no event data associated with the event. |
evEventData
Pointer to event data.
Retrieve the RTR data associated with this RTREvent object.
RTREvent.GetEventData(&evEventData);
rtr_msglen_t GetEventDataLength();
rtr_msglen_t: Returns the size of the event data length.
None
Retrieve the actual length of the data associated for this RTREvent object.
RTREvent.GetEventDataLength();
rtr_status_t GetEventNumber( rtr_evtnum_t &evEventNumber);
rtr_status_t Interpret value for the success or failure of this call.
Status | Message |
---|---|
RTR_STS_OK | Normal successful completion |
RTR_STS_NOEVENT | The data object does not contain an event. |
evEventNumber
An event number.
Call this member function to retrieve the RTR event associated with the data in this RTREvent object. This function is typically used by only those applications that do not register an event.
RTREvent.GetEventNumber(&evEventNumber);
Construction
Method | Description |
---|---|
RTRMessage() | Default constructor |
~RTRMessage() | Default destructor |
Operations
Method | Description |
---|---|
Dispatch() | Basic method. |
GetMessageType(rtr_msg_type_t) | Retrieve the RTR message associated with the data in this RTRMessage object. |
GetReason() | Retrieve the reason associated with the accepting or rejection of the transaction. |
GetSecondaryStatus() | Retrieve the secondary status associated with the accepting or rejection of the transaction. |
rtr_status_t Dispatch();
rtr_status_t Interpret value for the success or failure of this call.
Status | Message |
---|---|
RTR_STS_OK | Normal successful completion. |
RTR_STS_TCDELETED | The application has deleted the transaction controller. |
RTR_STS_NOMESSAGE | The data object does not contain a message. |
RTR_STS_HANDLERDELETED | The application has deleted the handler. |
RTR_STS_NOHANDLRREGSTRD | The application has not registered a handler. |
None
This member function must be overridden by the RTR application. When called, the data contained within the object is processed. Processing the data may include performing some application specific logic and/or dispatching to a handler.
sStatus = pOrderMessage->Dispatch();
rtr_status_t GetMessageType(rtr_msg_type_t& mtMessageType);
rtr_status_t Interpret value for the success or failure of this call.
Status | Message |
---|---|
RTR_STS_OK | Normal successful completion |
RTR_STS_NOMESSAGE | The data object does not contain a message |
mtMessageType
An RTR message.
Retrieve the RTR message associated with the data in this RTRMessage object.
sStatus = ((RTRMessage*)pResult)->GetMessageType(mtMessageType); print_status_on_failure(sStatus);
rtr_reason_t GetReason();
rtr_status_t This function either returns RTR_NO_REASON or the value specified by the participants in the transaction. If different participants provide different reason codes, RTR ORs them.
None
Retrieve the reason associated with the accepting or rejection of the transaction.
void OnAccepted(RTRMessage* pRTRData, RTRClientTransactionController* pController) { rtr_status_t sStatus = pRTRData->GetSecondaryStatus(); rtr_reason_t rcReasonCode = pRTRData->GetReason(); m_bAcceptReceived = true; };
rtr_status_t GetSecondaryStatus();
rtr_status_t Interpret value for the success or failure of this call.
Status | Message |
---|---|
RTR_STS_OK | Normal successful completion |
RTR_STS_NOMESSAGE | The data object does not contain a message. |
None
Retrieve the secondary status associated with the accepting or rejection of the transaction.
void OnAccepted(RTRMessage* pRTRData, RTRClientTransactionController* pController) { rtr_status_t sStatus = pRTRData->GetSecondaryStatus(); rtr_reason_t rcReasonCode = pRTRData->GetReason(); m_bAcceptReceived = true; };
Previous | Next | Contents | Index |