Open Lighting Architecture  0.9.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | 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

Public Types

enum  Direction { READ, WRITE }

Public Member Functions

 SelectServer (ola::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)
ola::thread::timeout_id RegisterRepeatingTimeout (unsigned int ms, ola::Callback0< bool > *closure)
ola::thread::timeout_id RegisterRepeatingTimeout (const ola::TimeInterval &interval, ola::Callback0< bool > *closure)
ola::thread::timeout_id RegisterSingleTimeout (unsigned int ms, ola::SingleUseCallback0< void > *closure)
ola::thread::timeout_id RegisterSingleTimeout (const ola::TimeInterval &interval, ola::SingleUseCallback0< void > *closure)
void RemoveTimeout (ola::thread::timeout_id id)
void RunInLoop (ola::Callback0< void > *closure)
void Execute (ola::BaseCallback0< void > *closure)

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: