#include <callback.hh>
Public Member Functions | |
Callback () | |
Constructor. | |
virtual | ~Callback () |
Destructor. | |
virtual void | readResponse (const ResponseId &respId, const AccData &data, const AccStamp &stamp, const AccEFICD &eficd, const AccDevRetStatus &cmpl)=0 |
Method used by read commands. | |
virtual void | response (const ResponseId &respId, const AccDevRetStatus &cmpl)=0 |
Method used by write and call commands. | |
virtual void | lifesign (const ResponseId &respId, const AccDevRetStatus &cmpl) |
Method to handle periodic lifesigns. | |
virtual void | error (const AsynchId &asyncId, const AccDevRetStatus &cmpl)=0 |
Method used to signal termination of connection. | |
bool | isActive () |
See if a callback method is currently active. | |
void | cbRef (CallbackReference *cbr) |
Set the protocol-specific callback reference. | |
CallbackReference * | cbRef () |
Return the protocol-specific callback reference. | |
bool | isActivated () |
See if protocol-specific callback reference exists. | |
Friends | |
class | CallbackReference |
Callback | ( | ) | [inline] |
Constructor.
virtual ~Callback | ( | ) | [virtual] |
Destructor.
CallbackReference* cbRef | ( | ) | [inline] |
Return the protocol-specific callback reference.
void cbRef | ( | CallbackReference * | cbr | ) |
Set the protocol-specific callback reference.
virtual void error | ( | const AsynchId & | asyncId, | |
const AccDevRetStatus & | cmpl | |||
) | [pure virtual] |
Method used to signal termination of connection.
asyncId | Identification of connection. | |
cmpl | Completion status, giving cause of termination. |
bool isActivated | ( | ) | [inline] |
See if protocol-specific callback reference exists.
bool isActive | ( | ) | [inline] |
See if a callback method is currently active.
The method should be used when Device::cancelRequest()
or Device::disconnect()
returns an error (e.g. ODA-W-CANCELUNSAFE
or ODA-W-DISCONNUNSAFE
) and it is not clear if a method of the callback object is still active. Deleting an active callback object may lead to a segmentation fault and program termination.
virtual void lifesign | ( | const ResponseId & | respId, | |
const AccDevRetStatus & | cmpl | |||
) | [virtual] |
Method to handle periodic lifesigns.
Usually, lifesign handling is done within the API and transparently for the application. A missing lifesign will be treated as broken connection and the application will be informed via its error() method with an appropriate error message.
Nevertheless, the application's callback class may overwrite the API's lifesign() method and do its own lifesign handling.
respId | Identification of connection. | |
cmpl | Completion status. |
virtual void readResponse | ( | const ResponseId & | respId, | |
const AccData & | data, | |||
const AccStamp & | stamp, | |||
const AccEFICD & | eficd, | |||
const AccDevRetStatus & | cmpl | |||
) | [pure virtual] |
Method used by read commands.
The methods requestRead() and connectRead() are using this method to respond.
respId | Identification of responding asynchronous command. | |
data | Data delivered by asynchronous command. | |
stamp | Time and event stamp of delivered data. | |
eficd | EFICD info of delivered data. | |
cmpl | Completion status. |
virtual void response | ( | const ResponseId & | respId, | |
const AccDevRetStatus & | cmpl | |||
) | [pure virtual] |
Method used by write and call commands.
The methods requestWrite(), requestCall(), connectWrite() and connectCall()are using this method to respond.
respId | Identification of responding asynchronous command. | |
cmpl | Completion status. |