Teonet library  0.4.7
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
teo::Teonet::CQue Class Reference

Teonet CQue callback function. More...

#include <teonet.hpp>

Public Types

typedef std::unique_ptr< CQuecquePtr
 

Public Member Functions

 CQue (Teonet *t, bool send_event=false)
 
 CQue (const CQue &obj)
 
virtual ~CQue ()
 
template<typename Callback , typename T >
cqueDataadd (Callback cb, T timeout=5.00, void *user_data=NULL)
 Add callback to queue. More...
 
template<typename T >
cqueDataadd (cqueCallback cb, T timeout=5.00, void *user_data=NULL)
 
template<typename T >
cqueDataadd (T timeout=5.00, void *user_data=NULL)
 
int remove (uint32_t id)
 
template<typename Callback >
void * find (void *find, const Callback compare, size_t *key_length=NULL)
 
template<typename Callback >
void * find (const std::string &find, const Callback compare, size_t *key_length=NULL)
 
int exec (uint32_t id)
 Execute callback queue record. More...
 
cqueDatagetData (void *data) const
 Get pointer to CQue data structure. More...
 
void * getCQueData (int id) const
 
uint32_t getId (cqueData *cd) const
 Get CQue data id. More...
 
TeonetgetTeonet () const
 Get pointer to teonet class object. More...
 
int setUserData (uint32_t id, void *data)
 Set callback queue data, update data set in ksnCQueAdd. More...
 

Detailed Description

Teonet CQue callback function.

Teonet CQue class

Member Typedef Documentation

typedef std::unique_ptr<CQue> teo::Teonet::CQue::cquePtr

Constructor & Destructor Documentation

teo::Teonet::CQue::CQue ( Teonet t,
bool  send_event = false 
)
inlineexplicit
teo::Teonet::CQue::CQue ( const CQue obj)
inline
virtual teo::Teonet::CQue::~CQue ( )
inlinevirtual

References ksnCQueDestroy().

Member Function Documentation

template<typename Callback , typename T >
cqueData* teo::Teonet::CQue::add ( Callback  cb,
timeout = 5.00,
void *  user_data = NULL 
)
inline

Add callback to queue.

Parameters
cbCallback function or NULL. The teonet event EV_K_CQUE_CALLBACK should be send at the same time.
timeoutCallback timeout. If equal to 0 than timeout sets automatically to 5 sec
user_dataThe user data which should be send to the Callback function
Returns
Pointer to added ksnCQueData or NULL if error occurred

References data, and ksnCQueAdd().

Referenced by teo::Teonet::TeoDB::send().

template<typename T >
cqueData* teo::Teonet::CQue::add ( cqueCallback  cb,
timeout = 5.00,
void *  user_data = NULL 
)
inline

References ksnCQueAdd().

template<typename T >
cqueData* teo::Teonet::CQue::add ( timeout = 5.00,
void *  user_data = NULL 
)
inline

References ksnCQueAdd().

int teo::Teonet::CQue::exec ( uint32_t  id)
inline

Execute callback queue record.

Execute callback queue record and remove it from queue

Parameters
idRequired ID
Returns
return 0: if callback executed OK; !=0 some error occurred

References ksnCQueExec().

Referenced by teo::Teonet::TeoDB::exec().

template<typename Callback >
void* teo::Teonet::CQue::find ( void *  find,
const Callback  compare,
size_t *  key_length = NULL 
)
inline

References ksnCQueFindData().

template<typename Callback >
void* teo::Teonet::CQue::find ( const std::string &  find,
const Callback  compare,
size_t *  key_length = NULL 
)
inline

References ksnCQueFindData().

void* teo::Teonet::CQue::getCQueData ( int  id) const
inline

References ksnCQueGetData().

cqueData* teo::Teonet::CQue::getData ( void *  data) const
inline

Get pointer to CQue data structure.

Parameters
dataPointer to data at EV_K_CQUE_CALLBACK event
Returns
Pointer to CQue data structure

References data.

uint32_t teo::Teonet::CQue::getId ( cqueData cd) const
inline

Get CQue data id.

Parameters
cdPointer to CQue data structure
Returns
CQue id

References ksnCQueData::id.

Teonet* teo::Teonet::CQue::getTeonet ( ) const
inline

Get pointer to teonet class object.

Returns
Pointer to teonet class object
int teo::Teonet::CQue::remove ( uint32_t  id)
inline

References ksnCQueRemove().

int teo::Teonet::CQue::setUserData ( uint32_t  id,
void *  data 
)
inline

Set callback queue data, update data set in ksnCQueAdd.

Parameters
idExisting callback queue ID
dataPointer to new user data
Returns
return 0: if data set OK; !=0 some error occurred

References data, and ksnCQueGetData().


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