zeus::FutureBase Class Reference

#include <FutureBase.hpp>

Inheritance diagram for zeus::FutureBase:
zeus::Future< ZEUS_RETURN > zeus::Future< void >

Public Member Functions

 FutureBase (const zeus::FutureBase &_base)
 
 FutureBase ()
 
 FutureBase (uint32_t _transactionId, zeus::FutureData::ObserverFinish _callback=nullptr, uint32_t _clientId=0)
 
 FutureBase (uint32_t _transactionId, ememory::SharedPtr< zeus::Buffer > _returnData, zeus::FutureData::ObserverFinish _callback=nullptr, uint32_t _clientId=0)
 
zeus::FutureBase operator= (const zeus::FutureBase &_base)
 
bool appendData (ememory::SharedPtr< zeus::Buffer > _returnValue)
 
void setSynchronous ()
 
uint32_t getTransactionId () const
 
uint32_t getClientId () const
 
bool hasError () const
 
std::string getErrorType () const
 
std::string getErrorHelp () const
 
bool isValid () const
 
bool isFinished () const
 
const FutureBasewait () const
 
const FutureBasewaitFor (std::chrono::microseconds _delta=std::chrono::seconds(30)) const
 
const FutureBasewaitUntil (std::chrono::steady_clock::time_point _endTime) const
 
ememory::SharedPtr< zeus::BuffergetRaw ()
 
std::chrono::nanoseconds getTransmitionTime () const
 

Public Attributes

ememory::SharedPtr< zeus::FutureDatam_data
 

Detailed Description

Generic zeus Future interface to get data asynchronously.

Constructor & Destructor Documentation

§ FutureBase() [1/4]

zeus::FutureBase::FutureBase ( const zeus::FutureBase _base)

Copy contructor of a FutureBase.

Parameters
[in]_basethe FutureBase to copy

§ FutureBase() [2/4]

zeus::FutureBase::FutureBase ( )

contructor of a FutureBase

§ FutureBase() [3/4]

zeus::FutureBase::FutureBase ( uint32_t  _transactionId,
zeus::FutureData::ObserverFinish  _callback = nullptr,
uint32_t  _clientId = 0 
)

Contructor of the FutureBase with an ofserver.

Parameters
[in]_transactionIdTransaction waiting answer
[in]_callbackObserver pointer
[in]_clientIdClient/sevice Id waiting answer

§ FutureBase() [4/4]

zeus::FutureBase::FutureBase ( uint32_t  _transactionId,
ememory::SharedPtr< zeus::Buffer _returnData,
zeus::FutureData::ObserverFinish  _callback = nullptr,
uint32_t  _clientId = 0 
)

Contructor of the FutureBase for direct error answer.

Parameters
[in]_transactionIdTransaction waiting answer
[in]_isFinishedset state finish or not
[in]_returnDataSet return value
[in]_callbackObserver pointer
[in]_clientIdClient/sevice Id waiting answer

Member Function Documentation

§ appendData()

bool zeus::FutureBase::appendData ( ememory::SharedPtr< zeus::Buffer _returnValue)

Add data on the call/answer.

Parameters
[in]_returnValueReturned buffer
Returns
return true if an error occured

§ getClientId()

uint32_t zeus::FutureBase::getClientId ( ) const

Get the client Id of the Future.

Returns
Client id requested or 0

§ getErrorHelp()

std::string zeus::FutureBase::getErrorHelp ( ) const

get help of the error

Returns
the string of the error help

§ getErrorType()

std::string zeus::FutureBase::getErrorType ( ) const

get type of the error

Returns
the string of the error type

§ getRaw()

ememory::SharedPtr<zeus::Buffer> zeus::FutureBase::getRaw ( )

Get the Buffer receive.

Returns
pointer on the receive data

§ getTransactionId()

uint32_t zeus::FutureBase::getTransactionId ( ) const

Get the transaction Id of the Future.

Returns
Transaction Id requested or 0

§ getTransmitionTime()

std::chrono::nanoseconds zeus::FutureBase::getTransmitionTime ( ) const

Get duration of the current trasaction take.

Returns
Tile in nanosecond to wait answer

§ hasError()

bool zeus::FutureBase::hasError ( ) const

check if the answer have an error

Returns
return true if an error is registered

§ isFinished()

bool zeus::FutureBase::isFinished ( ) const

Check if the futur have finish receiving data.

Returns
status of the fisnish state

§ isValid()

bool zeus::FutureBase::isValid ( ) const

Check if the Futur is a valid data.

Returns
return true if the data is valid

§ operator=()

zeus::FutureBase zeus::FutureBase::operator= ( const zeus::FutureBase _base)

Asignement operator with an other future.

Parameters
[in]_baseGeneric base Future
Returns
the reference on the local element

§ setSynchronous()

void zeus::FutureBase::setSynchronous ( )

Set the future syncronous.

Note
this mean that the system call the observer every time a packet arrive in the Future

§ wait()

const FutureBase& zeus::FutureBase::wait ( ) const

Wait the Future receive data.

Returns
reference on the current futur

§ waitFor()

const FutureBase& zeus::FutureBase::waitFor ( std::chrono::microseconds  _delta = std::chrono::seconds(30)) const

Wait the Future receive data.

Parameters
[in]_deltadelay to wait the data arrive
Returns
reference on the current futur

§ waitUntil()

const FutureBase& zeus::FutureBase::waitUntil ( std::chrono::steady_clock::time_point  _endTime) const

Wait the Future receive data.

Parameters
[in]_endTimetiem to wait the data
Returns
reference on the current futur

The documentation for this class was generated from the following file: