Open Lighting Architecture
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Static Public Attributes | Friends | List of all members
ola::io::SelectServer Class Reference

Detailed Description

This is the core of the event driven system. The SelectServer is responsible for invoking Callbacks when events occur. All methods except Execute() and Terminate() must be called from the thread that Run() was called in.

Inheritance diagram for ola::io::SelectServer:
ola::io::SelectServerInterface ola::thread::SchedulingExecutorInterface ola::thread::ExecutorInterface ola::thread::SchedulerInterface

Classes

struct  connected_descriptor_t
struct  connected_descriptor_t_lt
class  Event
struct  ltevent
class  RepeatingEvent
class  SingleEvent

Public Types

enum  Direction { READ, WRITE }

Public Member Functions

 SelectServer (ExportMap *export_map=NULL, Clock *clock=NULL)
bool IsRunning () const
const TimeStampWakeUpTime () const
void Terminate ()
void SetDefaultInterval (const TimeInterval &poll_interval)
void Run ()
void RunOnce (unsigned int delay_sec=POLL_INTERVAL_SECOND, unsigned int delay_usec=POLL_INTERVAL_USECOND)
bool AddReadDescriptor (ReadFileDescriptor *descriptor)
bool AddReadDescriptor (ConnectedDescriptor *descriptor, bool delete_on_close=false)
bool RemoveReadDescriptor (ReadFileDescriptor *descriptor)
bool RemoveReadDescriptor (ConnectedDescriptor *descriptor)
bool AddWriteDescriptor (WriteFileDescriptor *descriptor)
bool RemoveWriteDescriptor (WriteFileDescriptor *descriptor)
timeout_id RegisterRepeatingTimeout (unsigned int ms, ola::Callback0< bool > *closure)
timeout_id RegisterRepeatingTimeout (const ola::TimeInterval &interval, ola::Callback0< bool > *closure)
timeout_id RegisterSingleTimeout (unsigned int ms, ola::SingleUseCallback0< void > *closure)
timeout_id RegisterSingleTimeout (const ola::TimeInterval &interval, ola::SingleUseCallback0< void > *closure)
void RemoveTimeout (timeout_id id)
void RunInLoop (ola::Callback0< void > *closure)
void Execute (ola::BaseCallback0< void > *closure)
- Public Member Functions inherited from ola::io::SelectServerInterface
virtual void RemoveTimeout (ola::thread::timeout_id id)=0

Static Public Attributes

static const char K_READ_DESCRIPTOR_VAR [] = "ss-read-descriptors"
static const char K_WRITE_DESCRIPTOR_VAR [] = "ss-write-descriptor"
static const char K_CONNECTED_DESCRIPTORS_VAR [] = "ss-connected-descriptors"
static const char K_TIMER_VAR [] = "ss-timers"
static const char K_LOOP_TIME [] = "ss-loop-time"
static const char K_LOOP_COUNT [] = "ss-loop-count"

Friends

class ::SelectServerTest

Member Function Documentation

void ola::io::SelectServer::Execute ( ola::BaseCallback0< void > *  closure)
virtual

Execute this callback in the main select thread. This method can be called from any thread. The callback will never execute immediately, this can be used to perform delayed deletion of objects.

Implements ola::thread::ExecutorInterface.

void ola::io::SelectServer::Terminate ( )

A thread safe terminate


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