fesa-core
4.2.0
|
#include <AsyncGetCallback.h>
Inherits AsyncGetCallback, and noncopyable.
Public Member Functions | |
AsyncGetCallback (boost::shared_ptr< Semaphore > &semaphore) | |
bool | isCompleted () const |
bool | isSuccessful () const |
const cmw::rda3::common::AcquiredData & | getData () const |
std::auto_ptr < cmw::rda3::common::AcquiredData > | releaseData () |
const cmw::rda3::common::RdaException & | getException () const |
std::auto_ptr < cmw::rda3::common::RdaException > | releaseException () |
Simple implementation of RDA3's AsyncGetCallback, with the optional ability of posting to a semaphore when a callback (successful or not) is received.
|
explicit |
Calling this constructor will cause callbacks to call post() on semaphore.
const cmw::rda3::common::AcquiredData & fesa::AsyncGetCallback::getData | ( | ) | const |
Returns a reference to the data received.
FesaException | if isSuccessful() is false or if the data was released. |
const cmw::rda3::common::RdaException & fesa::AsyncGetCallback::getException | ( | ) | const |
Returns a reference to the exception received.
FesaException | if isSuccessful() is true or if the exception was released. |
bool fesa::AsyncGetCallback::isCompleted | ( | ) | const |
Returns true if the request is completed, whether it was successful or not.
bool fesa::AsyncGetCallback::isSuccessful | ( | ) | const |
Returns true if the request is completed and successful, false otherwise.
std::auto_ptr< cmw::rda3::common::AcquiredData > fesa::AsyncGetCallback::releaseData | ( | ) |
Returns an auto_ptr containing the received data. The data is not owned by this object any more, which is reset to its initial state.
std::auto_ptr< cmw::rda3::common::RdaException > fesa::AsyncGetCallback::releaseException | ( | ) |
Returns an auto_ptr containing the received exception. The exception is not owned by this object any more, which is reset to its initial state. calls to getException() will throw.