Scale Stack 0.3 Developer Documentation

scalestack::event::libevent::handler_provider Class Reference

#include <handler_provider.h>

Inheritance diagram for scalestack::event::libevent::handler_provider:
scalestack::event::handler_provider

Public Member Functions

 handler_provider (kernel::module &module, handler *handler, thread &thread)
 ~handler_provider ()
void start (void)
void stop (void)
void set_timer (uint64_t milliseconds)
void set_file_descriptor (int file_descriptor)
void watch_read (void)
void watch_write (void)
void run_now (void)
bool add_to_check_queue (void)
void check (void)

Private Member Functions

 handler_provider (const handler_provider &)
handler_provideroperator= (const handler_provider &)
void _notify_thread (void)
bool _event_has_changed (void)
void _update_event (void)
void _callback (int file_descriptor, short events)

Private Attributes

bool _in_check_queue
bool _need_start
bool _need_run
bool _need_stop
bool _is_processing
bool _is_set
bool _is_added
bool _watch_read
bool _set_watch_read
bool _watch_write
bool _set_watch_write
int _file_descriptor
int _set_file_descriptor
thread_thread
uint64_t _expire_time
uint64_t _set_expire_time
struct event _event
struct timeval _timer

Friends

void handler_provider_callback (int file_descriptor, short events, void *context)

Detailed Description

This is the event handler provider implementation for libevent.

Definition at line 50 of file handler_provider.h.


Constructor & Destructor Documentation

scalestack::event::libevent::handler_provider::handler_provider ( kernel::module module,
handler handler,
thread thread 
)

Constructor for the handler provider.

Parameters:
[in] module Module that the handler is associated with.
[in] handler Handler to pair with this handler provider.
[in] thread Thread to set.

Definition at line 62 of file handler_provider.cc.

scalestack::event::libevent::handler_provider::~handler_provider (  )  [virtual]

Reimplemented from scalestack::event::handler_provider.

Definition at line 87 of file handler_provider.cc.

scalestack::event::libevent::handler_provider::handler_provider ( const handler_provider  )  [private]

Don't allow copying of objects.


Member Function Documentation

void scalestack::event::libevent::handler_provider::start ( void   )  [virtual]

Start this handler provider by adding it to a thread.

Implements scalestack::event::handler_provider.

Definition at line 93 of file handler_provider.cc.

void scalestack::event::libevent::handler_provider::stop ( void   )  [virtual]
void scalestack::event::libevent::handler_provider::set_timer ( uint64_t  milliseconds  )  [virtual]
void scalestack::event::libevent::handler_provider::set_file_descriptor ( int  file_descriptor  )  [virtual]
void scalestack::event::libevent::handler_provider::watch_read ( void   )  [virtual]
void scalestack::event::libevent::handler_provider::watch_write ( void   )  [virtual]
void scalestack::event::libevent::handler_provider::run_now ( void   )  [virtual]
bool scalestack::event::libevent::handler_provider::add_to_check_queue ( void   ) 

Ask if the the handler provider should be added to the check queue. If so, also mark that it is now in the queue.

Returns:
Whether this should be added to the queue.

Definition at line 176 of file handler_provider.cc.

void scalestack::event::libevent::handler_provider::check ( void   ) 

Check to see if the handler provider needs to be started, stopped, run, or updated.

Definition at line 186 of file handler_provider.cc.

handler_provider& scalestack::event::libevent::handler_provider::operator= ( const handler_provider  )  [private]

Don't allow assignment of objects.

void scalestack::event::libevent::handler_provider::_notify_thread ( void   )  [private]

Notify handler provider that events should be updated.

Definition at line 261 of file handler_provider.cc.

bool scalestack::event::libevent::handler_provider::_event_has_changed ( void   )  [private]

CHeck to see if he event has changed from what is set.

Definition at line 276 of file handler_provider.cc.

void scalestack::event::libevent::handler_provider::_update_event ( void   )  [private]

Update the event handler structure with any changes.

Definition at line 303 of file handler_provider.cc.

void scalestack::event::libevent::handler_provider::_callback ( int  file_descriptor,
short  events 
) [private]

This is called when a libevent event notification happens.

Parameters:
[in] file_descriptor File descriptor for the event.
[in] events Type of events that are ready.

Definition at line 408 of file handler_provider.cc.


Friends And Related Function Documentation

void handler_provider_callback ( int  file_descriptor,
short  events,
void *  context 
) [friend]

Function passed to libevent to invoke handler_provider::_callback().


Field Documentation

Definition at line 149 of file handler_provider.h.

Definition at line 150 of file handler_provider.h.

Definition at line 151 of file handler_provider.h.

Definition at line 152 of file handler_provider.h.

Definition at line 153 of file handler_provider.h.

Definition at line 154 of file handler_provider.h.

Definition at line 155 of file handler_provider.h.

Definition at line 156 of file handler_provider.h.

Definition at line 157 of file handler_provider.h.

Definition at line 158 of file handler_provider.h.

Definition at line 159 of file handler_provider.h.

Definition at line 160 of file handler_provider.h.

Definition at line 161 of file handler_provider.h.

Definition at line 162 of file handler_provider.h.

Definition at line 163 of file handler_provider.h.

Definition at line 164 of file handler_provider.h.

Definition at line 165 of file handler_provider.h.

Definition at line 166 of file handler_provider.h.


The documentation for this class was generated from the following files:
Generated on Thu Feb 17 13:10:22 2011 by  doxygen 1.6.3