NAME

ACE_Proactor - An abstraction for Proactive I/O.

SYNOPSIS


#include <ace/Proactor.h>


class ACE_Proactor : public ACE_Event_Handler
{
  public:
    ACE_Proactor (size_t number_of_threads = 0);
    int close (void);
    virtual int handle_signal (
        int,
        siginfo_t * = 0,
        ucontext_t * = 0
        );
    virtual ACE_HANDLE get_handle (void) const;
    virtual int handle_events (ACE_Time_Value *how_long = 0);
    virtual int handle_events (ACE_Time_Value &how_long);
    virtual int initiate (
        ACE_Event_Handler *handler,
        ACE_Reactor_Mask mask = ACE_Event_Handler::WRITE_MASK,
        ACE_Message_Block *msg = 0,
        ACE_Overlapped_File *file = 0
        );
    virtual int schedule_timer (
        ACE_Event_Handler *,
        const void *arg,
        const ACE_Time_Value &delta,
        const ACE_Time_Value &interval = ACE_Time_Value::zero
        );
    virtual int cancel_timer (ACE_Event_Handler *handler);
    virtual int cancel_timer (int timer_id, const void **arg = 0);
  protected:
    ACE_Timer_Queue timer_queue_;
    ACE_Time_Value timer_skew_;
    virtual int initiate (ACE_Overlapped_IO *overlapped);
    int dispatch (
        ACE_Overlapped_IO *overlapped,
        u_long bytes_transfered
        );
    ACE_HANDLE completion_port_;
    size_t number_of_threads_;
    ACE_HANDLE global_handle_;
};

DESCRIPTION

The ACE_Proactor encapsulates Win32 overlapped I/O. The ACE_Proactor is also an ACE_Event_Handler which can be registered with the ACE_ReactorEx, as follows: int main () { // ... // Register Proactor with ReactorEx. ACE_Service_Config::reactorEx ()-register_handler (ACE_Service_Config::proactor ()); // Demultiplex all ReactorEx and Proactor events from a single // thread. ACE_Service_Config::run_reactorEx_event_loop (); return 42; } This makes it possible to seemlessly integrate the ACE_Proactor (which handles only overlapped I/O) with other forms of Win32 HANDLE-based synchronization (e.g., Mutexes, Semaphores, Threads, Processes, etc.).

Initialization and termination methods.

ACE_Proactor (size_t number_of_threads = 0);
int close (void);

Event demultiplexing hooks inherited from Event_Handler.

virtual int handle_signal (int, siginfo_t * = 0, ucontext_t * = 0);
virtual ACE_HANDLE get_handle (void) const;

Event loop methods.

virtual int handle_events (ACE_Time_Value *how_long = 0);
virtual int handle_events (ACE_Time_Value &how_long);

Communication method.

virtual int initiate (
    ACE_Event_Handler *handler,
    ACE_Reactor_Mask mask = ACE_Event_Handler::WRITE_MASK,
    ACE_Message_Block *msg = 0,
    ACE_Overlapped_File *file = 0
    );

Timer management.

virtual int schedule_timer (
    ACE_Event_Handler *,
    const void *arg,
    const ACE_Time_Value &delta,
    const ACE_Time_Value &interval = ACE_Time_Value::zero
    );
virtual int cancel_timer (ACE_Event_Handler *handler);
virtual int cancel_timer (int timer_id, const void **arg = 0);

AUTHOR

Doug Schmidt (schmidt@cs.wustl.edu), Tim Harrison (harrison@cs.wustl.edu), and Irfan Pyarali (ip1@cs.wustl.edu).

LIBRARY

ace