Callback Class Reference

Callback interface for asynchronous device accesses. More...

#include <callback.hh>

List of all members.

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.
CallbackReferencecbRef ()
 Return the protocol-specific callback reference.
bool isActivated ()
 See if protocol-specific callback reference exists.

Friends

class CallbackReference


Detailed Description

Callback interface for asynchronous device accesses.
Examples:

client.cc.


Constructor & Destructor Documentation

Callback (  )  [inline]

Constructor.

virtual ~Callback (  )  [virtual]

Destructor.


Member Function Documentation

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.

Parameters:
asyncId Identification of connection.
cmpl Completion status, giving cause of termination.
Note:
Method must be complete within 3s! Otherwise a server timeout will occur.
Examples:
client.cc.

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.

Parameters:
respId Identification of connection.
cmpl Completion status.
Note:
Method must be complete within 3s! Otherwise a server timeout will occur.

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.

Parameters:
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.
Note:
Method must be complete within 3s! Otherwise a server timeout will occur.
Examples:
client.cc.

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.

Parameters:
respId Identification of responding asynchronous command.
cmpl Completion status.
Examples:
client.cc.


The documentation for this class was generated from the following file:
Generated on 7 Feb 2013 for Client Device Access API by  doxygen 1.4.7