ACE 8.0.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Types | Private Member Functions | Friends | List of all members
ACE_Proactor Class Reference

A manager for asynchronous event demultiplexing. More...

#include <Proactor.h>

Collaboration diagram for ACE_Proactor:
Collaboration graph
[legend]

Public Types

typedef int(* PROACTOR_EVENT_HOOK) (ACE_Proactor *)
 

Public Member Functions

 ACE_Proactor (ACE_Proactor_Impl *implementation=0, bool delete_implementation=false, ACE_Proactor_Timer_Queue *tq=0)
 
 ~ACE_Proactor ()
 Destruction.
 
int close ()
 Close the associated ACE_Proactor_Impl implementation object.
 
int proactor_run_event_loop (PROACTOR_EVENT_HOOK=0)
 
int proactor_run_event_loop (ACE_Time_Value &tv, PROACTOR_EVENT_HOOK=0)
 
int proactor_end_event_loop ()
 
int proactor_event_loop_done ()
 Report if the ACE_Proactor event loop is finished.
 
int proactor_reset_event_loop ()
 
int register_handle (ACE_HANDLE handle, const void *completion_key)
 
long schedule_timer (ACE_Handler &handler, const void *act, const ACE_Time_Value &time)
 
long schedule_repeating_timer (ACE_Handler &handler, const void *act, const ACE_Time_Value &interval)
 
long schedule_timer (ACE_Handler &handler, const void *act, const ACE_Time_Value &time, const ACE_Time_Value &interval)
 
int cancel_timer (ACE_Handler &handler, int dont_call_handle_close=1)
 
int cancel_timer (long timer_id, const void **act=0, int dont_call_handle_close=1)
 
int handle_events (ACE_Time_Value &wait_time)
 
int handle_events ()
 
int wake_up_dispatch_threads ()
 Add wakeup dispatch threads (reinit).
 
int close_dispatch_threads (int wait)
 Close all dispatch threads.
 
size_t number_of_threads () const
 Get number of thread used as a parameter to CreatIoCompletionPort.
 
void number_of_threads (size_t threads)
 Set number of thread used as a parameter to CreatIoCompletionPort.
 
ACE_Proactor_Timer_Queuetimer_queue () const
 Get timer queue.
 
void timer_queue (ACE_Proactor_Timer_Queue *timer_queue)
 Set timer queue.
 
ACE_HANDLE get_handle () const
 
ACE_Proactor_Implimplementation () const
 Get the implementation class.
 
ACE_Asynch_Read_Stream_Implcreate_asynch_read_stream ()
 
ACE_Asynch_Write_Stream_Implcreate_asynch_write_stream ()
 
ACE_Asynch_Read_File_Implcreate_asynch_read_file ()
 
ACE_Asynch_Write_File_Implcreate_asynch_write_file ()
 
ACE_Asynch_Accept_Implcreate_asynch_accept ()
 Create the correct implementation class for doing Asynch_Accept.
 
ACE_Asynch_Connect_Implcreate_asynch_connect ()
 Create the correct implementation class for doing Asynch_Connect.
 
ACE_Asynch_Transmit_File_Implcreate_asynch_transmit_file ()
 
ACE_Asynch_Read_Dgram_Implcreate_asynch_read_dgram ()
 
ACE_Asynch_Write_Dgram_Implcreate_asynch_write_dgram ()
 
ACE_Asynch_Read_Stream_Result_Implcreate_asynch_read_stream_result (ACE_Handler::Proxy_Ptr &handler_proxy, ACE_HANDLE handle, ACE_Message_Block &message_block, u_long bytes_to_read, const void *act, ACE_HANDLE event=ACE_INVALID_HANDLE, int priority=0, int signal_number=ACE_SIGRTMIN)
 
ACE_Asynch_Write_Stream_Result_Implcreate_asynch_write_stream_result (ACE_Handler::Proxy_Ptr &handler_proxy, ACE_HANDLE handle, ACE_Message_Block &message_block, u_long bytes_to_write, const void *act, ACE_HANDLE event=ACE_INVALID_HANDLE, int priority=0, int signal_number=ACE_SIGRTMIN)
 
ACE_Asynch_Read_File_Result_Implcreate_asynch_read_file_result (ACE_Handler::Proxy_Ptr &handler_proxy, ACE_HANDLE handle, ACE_Message_Block &message_block, u_long bytes_to_read, const void *act, u_long offset, u_long offset_high, ACE_HANDLE event=ACE_INVALID_HANDLE, int priority=0, int signal_number=ACE_SIGRTMIN)
 
ACE_Asynch_Write_File_Result_Implcreate_asynch_write_file_result (ACE_Handler::Proxy_Ptr &handler_proxy, ACE_HANDLE handle, ACE_Message_Block &message_block, u_long bytes_to_write, const void *act, u_long offset, u_long offset_high, ACE_HANDLE event=ACE_INVALID_HANDLE, int priority=0, int signal_number=ACE_SIGRTMIN)
 
ACE_Asynch_Read_Dgram_Result_Implcreate_asynch_read_dgram_result (ACE_Handler::Proxy_Ptr &handler_proxy, ACE_HANDLE handle, ACE_Message_Block *message_block, size_t bytes_to_read, int flags, int protocol_family, const void *act, ACE_HANDLE event=ACE_INVALID_HANDLE, int priority=0, int signal_number=ACE_SIGRTMIN)
 
ACE_Asynch_Write_Dgram_Result_Implcreate_asynch_write_dgram_result (ACE_Handler::Proxy_Ptr &handler_proxy, ACE_HANDLE handle, ACE_Message_Block *message_block, size_t bytes_to_write, int flags, const void *act, ACE_HANDLE event=ACE_INVALID_HANDLE, int priority=0, int signal_number=ACE_SIGRTMIN)
 
ACE_Asynch_Accept_Result_Implcreate_asynch_accept_result (ACE_Handler::Proxy_Ptr &handler_proxy, ACE_HANDLE listen_handle, ACE_HANDLE accept_handle, ACE_Message_Block &message_block, u_long bytes_to_read, const void *act, ACE_HANDLE event=ACE_INVALID_HANDLE, int priority=0, int signal_number=ACE_SIGRTMIN)
 Create the correct implementation class for ACE_Asynch_Accept::Result.
 
ACE_Asynch_Connect_Result_Implcreate_asynch_connect_result (ACE_Handler::Proxy_Ptr &handler_proxy, ACE_HANDLE connect_handle, const void *act, ACE_HANDLE event=ACE_INVALID_HANDLE, int priority=0, int signal_number=ACE_SIGRTMIN)
 Create the correct implementation class for ACE_Asynch_Connect::Result.
 
ACE_Asynch_Transmit_File_Result_Implcreate_asynch_transmit_file_result (ACE_Handler::Proxy_Ptr &handler_proxy, ACE_HANDLE socket, ACE_HANDLE file, ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer, u_long bytes_to_write, u_long offset, u_long offset_high, u_long bytes_per_send, u_long flags, const void *act, ACE_HANDLE event=ACE_INVALID_HANDLE, int priority=0, int signal_number=ACE_SIGRTMIN)
 
ACE_Asynch_Result_Implcreate_asynch_timer (ACE_Handler::Proxy_Ptr &handler_proxy, const void *act, const ACE_Time_Value &tv, ACE_HANDLE event=ACE_INVALID_HANDLE, int priority=0, int signal_number=ACE_SIGRTMIN)
 

Static Public Member Functions

static ACE_Proactorinstance (size_t threads=0)
 
static ACE_Proactorinstance (ACE_Proactor *proactor, bool delete_proactor=false)
 
static void close_singleton ()
 Delete the dynamically allocated Singleton.
 
static void cleanup (void *instance, void *arg)
 
static const ACE_TCHARdll_name ()
 Name of dll in which the singleton instance lives.
 
static const ACE_TCHARname ()
 Name of component–ACE_Proactor in this case.
 
static int run_event_loop ()
 
static int run_event_loop (ACE_Time_Value &tv)
 
static int end_event_loop ()
 
static int reset_event_loop ()
 
static int check_reconfiguration (ACE_Proactor *)
 
static int event_loop_done ()
 Report if the <ACE_Proactor::instance> event loop is finished.
 

Protected Member Functions

int proactor_post_wakeup_completions (int how_many)
 
void implementation (ACE_Proactor_Impl *implementation)
 Set the implementation class.
 

Static Protected Member Functions

static int post_wakeup_completions (int how_many)
 

Protected Attributes

ACE_Proactor_Implimplementation_
 
bool delete_implementation_
 
ACE_Proactor_Timer_Handlertimer_handler_
 Handles timeout events.
 
ACE_Thread_Manager thr_mgr_
 This will manage the thread in the Timer_Handler.
 
ACE_Proactor_Timer_Queuetimer_queue_
 Timer Queue.
 
int delete_timer_queue_
 Flag on whether to delete the timer queue.
 
sig_atomic_t end_event_loop_
 Terminate the proactor event loop.
 
sig_atomic_t event_loop_thread_count_
 Number of threads in the event loop.
 
ACE_SYNCH_MUTEX mutex_
 Mutex to protect work with lists.
 

Static Protected Attributes

static ACE_Proactorproactor_ = 0
 Pointer to a process-wide ACE_Proactor.
 
static bool delete_proactor_ = false
 Must delete the <proactor_> if true.
 

Private Types

typedef ACE_Timer_Queue_Iterator_T< ACE_Handler * > TIMER_QUEUE_ITERATOR
 
typedef ACE_Timer_List_T< ACE_Handler *, ACE_Proactor_Handle_Timeout_Upcall, ACE_SYNCH_RECURSIVE_MUTEXTIMER_LIST
 
typedef ACE_Timer_List_Iterator_T< ACE_Handler *, ACE_Proactor_Handle_Timeout_Upcall, ACE_SYNCH_RECURSIVE_MUTEXTIMER_LIST_ITERATOR
 
typedef ACE_Timer_Heap_T< ACE_Handler *, ACE_Proactor_Handle_Timeout_Upcall, ACE_SYNCH_RECURSIVE_MUTEXTIMER_HEAP
 
typedef ACE_Timer_Heap_Iterator_T< ACE_Handler *, ACE_Proactor_Handle_Timeout_Upcall, ACE_SYNCH_RECURSIVE_MUTEXTIMER_HEAP_ITERATOR
 
typedef ACE_Timer_Wheel_T< ACE_Handler *, ACE_Proactor_Handle_Timeout_Upcall, ACE_SYNCH_RECURSIVE_MUTEXTIMER_WHEEL
 
typedef ACE_Timer_Wheel_Iterator_T< ACE_Handler *, ACE_Proactor_Handle_Timeout_Upcall, ACE_SYNCH_RECURSIVE_MUTEXTIMER_WHEEL_ITERATOR
 

Private Member Functions

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

Friends

class ACE_Proactor_Timer_Handler
 

Detailed Description

A manager for asynchronous event demultiplexing.

See the Proactor pattern description at http://www.dre.vanderbilt.edu/~schmidt/PDF/proactor.pdf for more details.

Member Typedef Documentation

◆ PROACTOR_EVENT_HOOK

typedef int(* ACE_Proactor::PROACTOR_EVENT_HOOK) (ACE_Proactor *)

You can add a hook to various run_event methods and the hook will be called after handling every proactor event. If this function returns 0, proactor_run_event_loop will check for the return value of handle_events. If it is -1, the the proactor_run_event_loop will return (pre-maturely.)

◆ TIMER_HEAP

◆ TIMER_HEAP_ITERATOR

◆ TIMER_LIST

◆ TIMER_LIST_ITERATOR

◆ TIMER_QUEUE_ITERATOR

◆ TIMER_WHEEL

◆ TIMER_WHEEL_ITERATOR

Constructor & Destructor Documentation

◆ ACE_Proactor() [1/2]

ACE_Proactor::ACE_Proactor ( ACE_Proactor_Impl * implementation = 0,
bool delete_implementation = false,
ACE_Proactor_Timer_Queue * tq = 0 )

Constructor. If implementation is 0, the correct implementation object will be created. delete_implementation flag determines whether the implementation object should be deleted by the Proactor or not. If tq is 0, a new TIMER_QUEUE is created.

◆ ~ACE_Proactor()

ACE_Proactor::~ACE_Proactor ( )

Destruction.

◆ ACE_Proactor() [2/2]

ACE_Proactor::ACE_Proactor ( const ACE_Proactor & )
private

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

Member Function Documentation

◆ cancel_timer() [1/2]

int ACE_Proactor::cancel_timer ( ACE_Handler & handler,
int dont_call_handle_close = 1 )

Cancel all timers associated with this handler. Returns number of timers cancelled.

◆ cancel_timer() [2/2]

int ACE_Proactor::cancel_timer ( long timer_id,
const void ** act = 0,
int dont_call_handle_close = 1 )

Cancel the single <ACE_Handler> that matches the timer_id value (which was returned from the <schedule> method). If act is non-NULL then it will be set to point to the `‘magic cookie’' argument passed in when the <Handler> was registered. This makes it possible to free up the memory and avoid memory leaks. Returns 1 if cancellation succeeded and 0 if the timer_id wasn't found.

◆ check_reconfiguration()

int ACE_Proactor::check_reconfiguration ( ACE_Proactor * )
static

The singleton proactor is used by the ACE_Service_Config. Therefore, we must check for the reconfiguration request and handle it after handling an event.

◆ cleanup()

static void ACE_Proactor::cleanup ( void * instance,
void * arg )
static

Cleanup method, used by the ACE_Object_Manager to destroy the singleton.

◆ close()

int ACE_Proactor::close ( )

Close the associated ACE_Proactor_Impl implementation object.

If

  • delete_implementation was specified to the open() method, the implementation object is also deleted.

◆ close_dispatch_threads()

int ACE_Proactor::close_dispatch_threads ( int wait)

Close all dispatch threads.

◆ close_singleton()

void ACE_Proactor::close_singleton ( )
static

Delete the dynamically allocated Singleton.

◆ create_asynch_accept()

ACE_Asynch_Accept_Impl * ACE_Proactor::create_asynch_accept ( )

Create the correct implementation class for doing Asynch_Accept.

◆ create_asynch_accept_result()

ACE_Asynch_Accept_Result_Impl * ACE_Proactor::create_asynch_accept_result ( ACE_Handler::Proxy_Ptr & handler_proxy,
ACE_HANDLE listen_handle,
ACE_HANDLE accept_handle,
ACE_Message_Block & message_block,
u_long bytes_to_read,
const void * act,
ACE_HANDLE event = ACE_INVALID_HANDLE,
int priority = 0,
int signal_number = ACE_SIGRTMIN )

Create the correct implementation class for ACE_Asynch_Accept::Result.

◆ create_asynch_connect()

ACE_Asynch_Connect_Impl * ACE_Proactor::create_asynch_connect ( )

Create the correct implementation class for doing Asynch_Connect.

◆ create_asynch_connect_result()

ACE_Asynch_Connect_Result_Impl * ACE_Proactor::create_asynch_connect_result ( ACE_Handler::Proxy_Ptr & handler_proxy,
ACE_HANDLE connect_handle,
const void * act,
ACE_HANDLE event = ACE_INVALID_HANDLE,
int priority = 0,
int signal_number = ACE_SIGRTMIN )

Create the correct implementation class for ACE_Asynch_Connect::Result.

◆ create_asynch_read_dgram()

ACE_Asynch_Read_Dgram_Impl * ACE_Proactor::create_asynch_read_dgram ( )

Create the correct implementation class for doing Asynch_Read_Dgram.

◆ create_asynch_read_dgram_result()

ACE_Asynch_Read_Dgram_Result_Impl * ACE_Proactor::create_asynch_read_dgram_result ( ACE_Handler::Proxy_Ptr & handler_proxy,
ACE_HANDLE handle,
ACE_Message_Block * message_block,
size_t bytes_to_read,
int flags,
int protocol_family,
const void * act,
ACE_HANDLE event = ACE_INVALID_HANDLE,
int priority = 0,
int signal_number = ACE_SIGRTMIN )

Create the correct implementation class for ACE_Asynch_Read_Dgram::Result.

◆ create_asynch_read_file()

ACE_Asynch_Read_File_Impl * ACE_Proactor::create_asynch_read_file ( )

Create the correct implementation class for doing Asynch_Read_File.

◆ create_asynch_read_file_result()

ACE_Asynch_Read_File_Result_Impl * ACE_Proactor::create_asynch_read_file_result ( ACE_Handler::Proxy_Ptr & handler_proxy,
ACE_HANDLE handle,
ACE_Message_Block & message_block,
u_long bytes_to_read,
const void * act,
u_long offset,
u_long offset_high,
ACE_HANDLE event = ACE_INVALID_HANDLE,
int priority = 0,
int signal_number = ACE_SIGRTMIN )

Create the correct implementation class for ACE_Asynch_Read_File::Result.

◆ create_asynch_read_stream()

ACE_Asynch_Read_Stream_Impl * ACE_Proactor::create_asynch_read_stream ( )

Create the correct implementation class for doing Asynch_Read_Stream.

◆ create_asynch_read_stream_result()

ACE_Asynch_Read_Stream_Result_Impl * ACE_Proactor::create_asynch_read_stream_result ( ACE_Handler::Proxy_Ptr & handler_proxy,
ACE_HANDLE handle,
ACE_Message_Block & message_block,
u_long bytes_to_read,
const void * act,
ACE_HANDLE event = ACE_INVALID_HANDLE,
int priority = 0,
int signal_number = ACE_SIGRTMIN )

Create the correct implementation class for ACE_Asynch_Read_Stream::Result class.

◆ create_asynch_timer()

ACE_Asynch_Result_Impl * ACE_Proactor::create_asynch_timer ( ACE_Handler::Proxy_Ptr & handler_proxy,
const void * act,
const ACE_Time_Value & tv,
ACE_HANDLE event = ACE_INVALID_HANDLE,
int priority = 0,
int signal_number = ACE_SIGRTMIN )

Create a timer result object which can be used with the Timer mechanism of the Proactor. If signal_number is -1, <POSIX_SIG_Proactor> will create a Timer object with a meaningful signal number, choosing the largest signal number from the signal mask of the Proactor.

◆ create_asynch_transmit_file()

ACE_Asynch_Transmit_File_Impl * ACE_Proactor::create_asynch_transmit_file ( )

Create the correct implementation class for doing Asynch_Transmit_File.

◆ create_asynch_transmit_file_result()

ACE_Asynch_Transmit_File_Result_Impl * ACE_Proactor::create_asynch_transmit_file_result ( ACE_Handler::Proxy_Ptr & handler_proxy,
ACE_HANDLE socket,
ACE_HANDLE file,
ACE_Asynch_Transmit_File::Header_And_Trailer * header_and_trailer,
u_long bytes_to_write,
u_long offset,
u_long offset_high,
u_long bytes_per_send,
u_long flags,
const void * act,
ACE_HANDLE event = ACE_INVALID_HANDLE,
int priority = 0,
int signal_number = ACE_SIGRTMIN )

Create the correct implementation class for ACE_Asynch_Transmit_File::Result.

◆ create_asynch_write_dgram()

ACE_Asynch_Write_Dgram_Impl * ACE_Proactor::create_asynch_write_dgram ( )

Create the correct implementation class for doing Asynch_Write_Dgram.

◆ create_asynch_write_dgram_result()

ACE_Asynch_Write_Dgram_Result_Impl * ACE_Proactor::create_asynch_write_dgram_result ( ACE_Handler::Proxy_Ptr & handler_proxy,
ACE_HANDLE handle,
ACE_Message_Block * message_block,
size_t bytes_to_write,
int flags,
const void * act,
ACE_HANDLE event = ACE_INVALID_HANDLE,
int priority = 0,
int signal_number = ACE_SIGRTMIN )

Create the correct implementation class for ACE_Asynch_Write_Dgram::Result.

◆ create_asynch_write_file()

ACE_Asynch_Write_File_Impl * ACE_Proactor::create_asynch_write_file ( )

Create the correct implementation class for doing Asynch_Write_File.

◆ create_asynch_write_file_result()

ACE_Asynch_Write_File_Result_Impl * ACE_Proactor::create_asynch_write_file_result ( ACE_Handler::Proxy_Ptr & handler_proxy,
ACE_HANDLE handle,
ACE_Message_Block & message_block,
u_long bytes_to_write,
const void * act,
u_long offset,
u_long offset_high,
ACE_HANDLE event = ACE_INVALID_HANDLE,
int priority = 0,
int signal_number = ACE_SIGRTMIN )

Create the correct implementation class for ACE_Asynch_Write_File::Result.

◆ create_asynch_write_stream()

ACE_Asynch_Write_Stream_Impl * ACE_Proactor::create_asynch_write_stream ( )

Create the correct implementation class for doing Asynch_Write_Stream.

◆ create_asynch_write_stream_result()

ACE_Asynch_Write_Stream_Result_Impl * ACE_Proactor::create_asynch_write_stream_result ( ACE_Handler::Proxy_Ptr & handler_proxy,
ACE_HANDLE handle,
ACE_Message_Block & message_block,
u_long bytes_to_write,
const void * act,
ACE_HANDLE event = ACE_INVALID_HANDLE,
int priority = 0,
int signal_number = ACE_SIGRTMIN )

Create the correct implementation class for ACE_Asynch_Write_Stream::Result.

◆ dll_name()

const ACE_TCHAR * ACE_Proactor::dll_name ( )
static

Name of dll in which the singleton instance lives.

◆ end_event_loop()

int ACE_Proactor::end_event_loop ( )
inlinestatic

Instruct the <ACE_Proactor::instance> to terminate its event loop. This method wakes up all the threads blocked on waiting for completions and end the event loop.

◆ event_loop_done()

int ACE_Proactor::event_loop_done ( )
inlinestatic

Report if the <ACE_Proactor::instance> event loop is finished.

◆ get_handle()

ACE_HANDLE ACE_Proactor::get_handle ( ) const

Get the event handle. It is a no-op in POSIX platforms and it returns ACE_INVALID_HANDLE.

◆ handle_events() [1/2]

int ACE_Proactor::handle_events ( )

Block indefinitely until at least one event is dispatched.

Returns
Returns 1 when a completion is dispatched. On error, returns -1 and sets errno accordingly.

◆ handle_events() [2/2]

int ACE_Proactor::handle_events ( ACE_Time_Value & wait_time)

Dispatch a single set of events, waiting up to a specified time limit if necessary.

Parameters
wait_timethe time to wait for an event to occur. This is a relative time. On successful return, the time is updated to reflect the amount of time spent waiting for event(s) to occur.
Returns
Returns 0 if no events occur before the wait_time expires. Returns 1 when a completion is dispatched. On error, returns -1 and sets errno accordingly.

◆ implementation() [1/2]

ACE_Proactor_Impl * ACE_Proactor::implementation ( ) const

Get the implementation class.

◆ implementation() [2/2]

void ACE_Proactor::implementation ( ACE_Proactor_Impl * implementation)
protected

Set the implementation class.

◆ instance() [1/2]

ACE_Proactor * ACE_Proactor::instance ( ACE_Proactor * proactor,
bool delete_proactor = false )
static

Set pointer to a process-wide ACE_Proactor and return existing pointer.

◆ instance() [2/2]

ACE_Proactor * ACE_Proactor::instance ( size_t threads = 0)
static

Get pointer to a process-wide ACE_Proactor. threads should be part of another method.

◆ name()

const ACE_TCHAR * ACE_Proactor::name ( )
static

Name of component–ACE_Proactor in this case.

◆ number_of_threads() [1/2]

size_t ACE_Proactor::number_of_threads ( ) const

Get number of thread used as a parameter to CreatIoCompletionPort.

◆ number_of_threads() [2/2]

void ACE_Proactor::number_of_threads ( size_t threads)

Set number of thread used as a parameter to CreatIoCompletionPort.

◆ operator=()

ACE_Proactor & ACE_Proactor::operator= ( const ACE_Proactor & )
private

◆ post_wakeup_completions()

int ACE_Proactor::post_wakeup_completions ( int how_many)
inlinestaticprotected

Post <how_many> completions to the completion port so that all threads can wake up. This is used in conjunction with the <run_event_loop>.

◆ proactor_end_event_loop()

int ACE_Proactor::proactor_end_event_loop ( )

Instruct the ACE_Proactor to terminate its event loop and notifies the ACE_Proactor so that it can wake up and close down gracefully.

◆ proactor_event_loop_done()

int ACE_Proactor::proactor_event_loop_done ( )

Report if the ACE_Proactor event loop is finished.

◆ proactor_post_wakeup_completions()

int ACE_Proactor::proactor_post_wakeup_completions ( int how_many)
protected

Post <how_many> completions to the completion port so that all threads can wake up. This is used in conjunction with the <proactor_run_event_loop>.

◆ proactor_reset_event_loop()

int ACE_Proactor::proactor_reset_event_loop ( )

Resets the <ACE_Proactor::end_event_loop_> static so that the <run_event_loop> method can be restarted.

◆ proactor_run_event_loop() [1/2]

int ACE_Proactor::proactor_run_event_loop ( ACE_Time_Value & tv,
PROACTOR_EVENT_HOOK eh = 0 )

Run the event loop until the <ACE_Proactor::handle_events> method returns -1, the <end_proactor_event_loop> method is invoked, or the ACE_Time_Value expires, in which case a 0 is returned.

◆ proactor_run_event_loop() [2/2]

int ACE_Proactor::proactor_run_event_loop ( PROACTOR_EVENT_HOOK eh = 0)

Run the event loop until the <ACE_Proactor::handle_events> method returns -1 or the <end_proactor_event_loop> method is invoked.

◆ register_handle()

int ACE_Proactor::register_handle ( ACE_HANDLE handle,
const void * completion_key )

This method adds the handle to the I/O completion port. This function is a no-op function for Unix systems and returns 0;

◆ reset_event_loop()

int ACE_Proactor::reset_event_loop ( )
inlinestatic

Resets the <ACE_Proactor::end_event_loop_> static so that the <run_event_loop> method can be restarted.

◆ run_event_loop() [1/2]

int ACE_Proactor::run_event_loop ( )
inlinestatic

Run the event loop until the <ACE_Proactor::handle_events> method returns -1 or the <end_event_loop> method is invoked.

◆ run_event_loop() [2/2]

int ACE_Proactor::run_event_loop ( ACE_Time_Value & tv)
inlinestatic

Run the event loop until the <ACE_Proactor::handle_events> method returns -1, the <end_event_loop> method is invoked, or the ACE_Time_Value expires, in which case 0 is returned.

◆ schedule_repeating_timer()

long ACE_Proactor::schedule_repeating_timer ( ACE_Handler & handler,
const void * act,
const ACE_Time_Value & interval )

◆ schedule_timer() [1/2]

long ACE_Proactor::schedule_timer ( ACE_Handler & handler,
const void * act,
const ACE_Time_Value & time )

Schedule a handler that will expire after <time>. If it expires then act is passed in as the value to the handler's <handle_timeout> callback method. This method returns a <timer_id>. This <timer_id> can be used to cancel a timer before it expires. The cancellation ensures that <timer_ids> are unique up to values of greater than 2 billion timers. As long as timers don't stay around longer than this there should be no problems with accidentally deleting the wrong timer. Returns -1 on failure (which is guaranteed never to be a valid <timer_id>).

◆ schedule_timer() [2/2]

long ACE_Proactor::schedule_timer ( ACE_Handler & handler,
const void * act,
const ACE_Time_Value & time,
const ACE_Time_Value & interval )

Same as above except interval it is used to reschedule the handler automatically. This combines the above two methods into one. Mostly for backward compatibility.

◆ timer_queue() [1/2]

ACE_Proactor_Timer_Queue * ACE_Proactor::timer_queue ( ) const

Get timer queue.

◆ timer_queue() [2/2]

void ACE_Proactor::timer_queue ( ACE_Proactor_Timer_Queue * timer_queue)

Set timer queue.

◆ wake_up_dispatch_threads()

int ACE_Proactor::wake_up_dispatch_threads ( )

Add wakeup dispatch threads (reinit).

Friends And Related Symbol Documentation

◆ ACE_Proactor_Timer_Handler

Timer handler runs a thread and manages the timers, on behalf of the Proactor.

Member Data Documentation

◆ delete_implementation_

bool ACE_Proactor::delete_implementation_
protected

Flag used to indicate whether we are responsible for cleaning up the implementation instance.

◆ delete_proactor_

bool ACE_Proactor::delete_proactor_ = false
staticprotected

Must delete the <proactor_> if true.

Controls whether the Proactor is deleted when we shut down (we can only delete it safely if we created it!)

◆ delete_timer_queue_

int ACE_Proactor::delete_timer_queue_
protected

Flag on whether to delete the timer queue.

◆ end_event_loop_

sig_atomic_t ACE_Proactor::end_event_loop_
protected

Terminate the proactor event loop.

◆ event_loop_thread_count_

sig_atomic_t ACE_Proactor::event_loop_thread_count_
protected

Number of threads in the event loop.

◆ implementation_

ACE_Proactor_Impl* ACE_Proactor::implementation_
protected

Delegation/implementation class that all methods will be forwarded to.

◆ mutex_

ACE_SYNCH_MUTEX ACE_Proactor::mutex_
protected

Mutex to protect work with lists.

◆ proactor_

ACE_Proactor * ACE_Proactor::proactor_ = 0
staticprotected

Pointer to a process-wide ACE_Proactor.

Process-wide ACE_Proactor.

◆ thr_mgr_

ACE_Thread_Manager ACE_Proactor::thr_mgr_
protected

This will manage the thread in the Timer_Handler.

◆ timer_handler_

ACE_Proactor_Timer_Handler* ACE_Proactor::timer_handler_
protected

Handles timeout events.

◆ timer_queue_

ACE_Proactor_Timer_Queue* ACE_Proactor::timer_queue_
protected

Timer Queue.


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