ACE  6.1.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends
ACE_Select_Reactor_Impl Class Reference

This class simply defines how Select_Reactor's basic interface functions should look like and provides a common base class for Select_Reactor using various locking mechanism. More...

#include <Select_Reactor_Base.h>

Inheritance diagram for ACE_Select_Reactor_Impl:
Inheritance graph
[legend]
Collaboration diagram for ACE_Select_Reactor_Impl:
Collaboration graph
[legend]

List of all members.

Public Types

enum  { DEFAULT_SIZE = ACE_DEFAULT_SELECT_REACTOR_SIZE }

Public Member Functions

 ACE_Select_Reactor_Impl (bool mask_signals=true)
 Constructor.
virtual int purge_pending_notifications (ACE_Event_Handler *=0, ACE_Reactor_Mask=ACE_Event_Handler::ALL_EVENTS_MASK)
virtual int resumable_handler (void)

Protected Member Functions

virtual int bit_ops (ACE_HANDLE handle, ACE_Reactor_Mask mask, ACE_Select_Reactor_Handle_Set &handle_set, int ops)
 Allow manipulation of the <wait_set_> mask and <ready_set_> mask.
virtual void renew (void)=0
virtual int is_suspended_i (ACE_HANDLE handle)=0
virtual void clear_dispatch_mask (ACE_HANDLE handle, ACE_Reactor_Mask mask)
int supress_notify_renew (void)
void supress_notify_renew (int sr)

Protected Attributes

ACE_Select_Reactor_Handler_Repository handler_rep_
 Table that maps <ACE_HANDLEs> to <ACE_Event_Handler *>'s.
ACE_Select_Reactor_Handle_Set dispatch_set_
 Tracks handles that are ready for dispatch from <select>
ACE_Select_Reactor_Handle_Set wait_set_
 Tracks handles that are waited for by <select>.
ACE_Select_Reactor_Handle_Set suspend_set_
 Tracks handles that are currently suspended.
ACE_Select_Reactor_Handle_Set ready_set_
ACE_Timer_Queuetimer_queue_
 Defined as a pointer to allow overriding by derived classes...
ACE_Sig_Handlersignal_handler_
 Handle signals without requiring global/static variables.
ACE_Reactor_Notifynotify_handler_
bool delete_timer_queue_
bool delete_signal_handler_
bool delete_notify_handler_
bool initialized_
 True if we've been initialized yet...
bool restart_
int requeue_position_
ACE_thread_t owner_
 The original thread that created this Select_Reactor.
bool state_changed_
bool mask_signals_

Private Member Functions

 ACE_Select_Reactor_Impl (const ACE_Select_Reactor_Impl &)
 Deny access since member-wise won't work...
ACE_Select_Reactor_Imploperator= (const ACE_Select_Reactor_Impl &)

Private Attributes

int supress_renew_

Friends

class ACE_Select_Reactor_Notify
class ACE_Select_Reactor_Handler_Repository

Detailed Description

This class simply defines how Select_Reactor's basic interface functions should look like and provides a common base class for Select_Reactor using various locking mechanism.


Member Enumeration Documentation

anonymous enum
Enumerator:
DEFAULT_SIZE 

Default size of the Select_Reactor's handle table.


Constructor & Destructor Documentation

ACE_Select_Reactor_Impl::ACE_Select_Reactor_Impl ( bool  mask_signals = true) [inline]

Constructor.

Deny access since member-wise won't work...


Member Function Documentation

int ACE_Select_Reactor_Impl::bit_ops ( ACE_HANDLE  handle,
ACE_Reactor_Mask  mask,
ACE_Select_Reactor_Handle_Set handle_set,
int  ops 
) [protected, virtual]

Allow manipulation of the <wait_set_> mask and <ready_set_> mask.

void ACE_Select_Reactor_Impl::clear_dispatch_mask ( ACE_HANDLE  handle,
ACE_Reactor_Mask  mask 
) [protected, virtual]

When register/unregister occur, then we need to re-eval our wait/suspend/dispatch set.

Reimplemented in ACE_TP_Reactor.

virtual int ACE_Select_Reactor_Impl::is_suspended_i ( ACE_HANDLE  handle) [protected, pure virtual]

Check to see if the Event_Handler associated with handle is suspended. Returns 0 if not, 1 if so.

Implemented in ACE_Select_Reactor_T< ACE_SELECT_REACTOR_TOKEN >, and ACE_Select_Reactor_T< ACE_Select_Reactor_Token >.

ACE_Select_Reactor_Impl& ACE_Select_Reactor_Impl::operator= ( const ACE_Select_Reactor_Impl ) [private]

Purge any notifications pending in this reactor for the specified ACE_Event_Handler object. Returns the number of notifications purged. Returns -1 on error.

Implements ACE_Reactor_Impl.

virtual void ACE_Select_Reactor_Impl::renew ( void  ) [protected, pure virtual]

Enqueue ourselves into the list of waiting threads at the appropriate point specified by <requeue_position_>.

Implemented in ACE_Select_Reactor_T< ACE_SELECT_REACTOR_TOKEN >, and ACE_Select_Reactor_T< ACE_Select_Reactor_Token >.

Does the reactor allow the application to resume the handle on its own ie. can it pass on the control of handle resumption to the application. The select reactor has no handlers that can be resumed by the application. So return 0;

Implements ACE_Reactor_Impl.

Reimplemented in ACE_TP_Reactor.

int ACE_Select_Reactor_Impl::supress_notify_renew ( void  ) [inline, protected]

Controls/access whether the notify handler should renew the Select_Reactor's token or not.

void ACE_Select_Reactor_Impl::supress_notify_renew ( int  sr) [inline, protected]

Friends And Related Function Documentation

friend class ACE_Select_Reactor_Notify [friend]

Member Data Documentation

Keeps track of whether we need to delete the notify handler (if we didn't create it, then we don't delete it).

Keeps track of whether we should delete the signal handler (if we didn't create it, then we don't delete it).

Keeps track of whether we should delete the timer queue (if we didn't create it, then we don't delete it).

Tracks handles that are ready for dispatch from <select>

Table that maps <ACE_HANDLEs> to <ACE_Event_Handler *>'s.

True if we've been initialized yet...

If false then the Reactor will not mask the signals during the event dispatching. This is useful for applications that do not register any signal handlers and want to reduce the overhead introduce by the kernel level locks required to change the mask.

Callback object that unblocks the ACE_Select_Reactor if it's sleeping.

The original thread that created this Select_Reactor.

Track HANDLES we are interested in for various events that must be dispatched without going through <select>.

Position that the main ACE_Select_Reactor thread is requeued in the list of waiters during a <notify> callback. If this value == -1 we are requeued at the end of the list. Else if it's 0 then we are requeued at the front of the list. Else if it's > 1 then that indicates the number of waiters to skip over.

Restart the <handle_events> event-loop method automatically when <select> is interrupted via <EINTR>.

Handle signals without requiring global/static variables.

True if state has changed during dispatching of ACE_Event_Handlers, else false. This is used to determine whether we need to make another trip through the <Select_Reactor>'s <wait_for_multiple_events> loop.

Determine whether we should renew Select_Reactor's token after handling the notification message.

Tracks handles that are currently suspended.

Defined as a pointer to allow overriding by derived classes...

Tracks handles that are waited for by <select>.


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