0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
Hypertable::PollTimeout Class Reference

Maintains next timeout for event polling loop. More...

#include <PollTimeout.h>

Public Member Functions

 PollTimeout ()
 Constructor. More...
 
void set (ClockT::time_point now, ClockT::time_point expire)
 Sets the next timeout. More...
 
void set_indefinite ()
 Sets the next timeout to be an indefinite time in the future. More...
 
int get_millis ()
 Gets duration until next timeout in the form of milliseconds. More...
 
struct timespec * get_timespec ()
 Gets duration until next timeout in the form of a pointer to timespec. More...
 

Private Attributes

struct timespec * ts_ptr
 Pointer to to duration_ts or 0 if indefinite. More...
 
struct timespec duration_ts
 timespec structure holding duration until next timeout More...
 
std::chrono::milliseconds duration_millis {-1}
 Duration until next timeout in milliseconds. More...
 

Detailed Description

Maintains next timeout for event polling loop.

This class is used to maintain and provide access to the next timeout for the event polling loops. It contains accessor methods to return the timeout in different formats required by the various polling interfaces.

Definition at line 44 of file PollTimeout.h.

Constructor & Destructor Documentation

Hypertable::PollTimeout::PollTimeout ( )
inline

Constructor.

Definition at line 49 of file PollTimeout.h.

Member Function Documentation

int Hypertable::PollTimeout::get_millis ( )
inline

Gets duration until next timeout in the form of milliseconds.

Returns
Milliseconds until next timeout

Definition at line 74 of file PollTimeout.h.

struct timespec* Hypertable::PollTimeout::get_timespec ( )
inline

Gets duration until next timeout in the form of a pointer to timespec.

Returns
Pointer to timespec representing duration until next timeout.

Definition at line 79 of file PollTimeout.h.

void Hypertable::PollTimeout::set ( ClockT::time_point  now,
ClockT::time_point  expire 
)
inline

Sets the next timeout.

Parameters
nowCurrent time
expireAbsolute time of next timeout

Definition at line 55 of file PollTimeout.h.

void Hypertable::PollTimeout::set_indefinite ( )
inline

Sets the next timeout to be an indefinite time in the future.

Definition at line 66 of file PollTimeout.h.

Member Data Documentation

std::chrono::milliseconds Hypertable::PollTimeout::duration_millis {-1}
private

Duration until next timeout in milliseconds.

Definition at line 90 of file PollTimeout.h.

struct timespec Hypertable::PollTimeout::duration_ts
private

timespec structure holding duration until next timeout

Definition at line 87 of file PollTimeout.h.

struct timespec* Hypertable::PollTimeout::ts_ptr
private

Pointer to to duration_ts or 0 if indefinite.

Definition at line 84 of file PollTimeout.h.


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