summaryrefslogtreecommitdiff
path: root/ACE/ace/QtReactor
diff options
context:
space:
mode:
authorWilliam R. Otte <wotte@dre.vanderbilt.edu>2008-03-04 13:56:48 +0000
committerWilliam R. Otte <wotte@dre.vanderbilt.edu>2008-03-04 13:56:48 +0000
commitc4078c377d74290ebe4e66da0b4975da91732376 (patch)
tree1816ef391e42a07929304908ac0e21f4c2f6cb7b /ACE/ace/QtReactor
parent700d1c1a6be348c6c70a2085e559baeb8f4a62ea (diff)
downloadATCD-c4078c377d74290ebe4e66da0b4975da91732376.tar.gz
swap in externals for ACE and TAO
Diffstat (limited to 'ACE/ace/QtReactor')
-rw-r--r--ACE/ace/QtReactor/ACE_QtReactor.pc.in11
-rw-r--r--ACE/ace/QtReactor/ACE_QtReactor_export.h58
-rw-r--r--ACE/ace/QtReactor/QtReactor.cpp644
-rw-r--r--ACE/ace/QtReactor/QtReactor.h231
4 files changed, 0 insertions, 944 deletions
diff --git a/ACE/ace/QtReactor/ACE_QtReactor.pc.in b/ACE/ace/QtReactor/ACE_QtReactor.pc.in
deleted file mode 100644
index 4e7aa83e6be..00000000000
--- a/ACE/ace/QtReactor/ACE_QtReactor.pc.in
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: ACE_QtReactor
-Description: ACE QtReactor Library
-Requires: ACE
-Version: @VERSION@
-Libs: -L${libdir} -lACE_QtReactor
-Cflags: -I${includedir}
diff --git a/ACE/ace/QtReactor/ACE_QtReactor_export.h b/ACE/ace/QtReactor/ACE_QtReactor_export.h
deleted file mode 100644
index f7192051a29..00000000000
--- a/ACE/ace/QtReactor/ACE_QtReactor_export.h
+++ /dev/null
@@ -1,58 +0,0 @@
-
-// -*- C++ -*-
-// $Id$
-// Definition for Win32 Export directives.
-// This file is generated automatically by generate_export_file.pl -s ACE_QtReactor
-// ------------------------------
-#ifndef ACE_QTREACTOR_EXPORT_H
-#define ACE_QTREACTOR_EXPORT_H
-
-#include /**/ "ace/config-all.h"
-
-#if defined (ACE_AS_STATIC_LIBS) && !defined (ACE_QTREACTOR_HAS_DLL)
-# define ACE_QTREACTOR_HAS_DLL 0
-#endif /* ACE_AS_STATIC_LIBS && ACE_QTREACTOR_HAS_DLL */
-
-#if !defined (ACE_QTREACTOR_HAS_DLL)
-# define ACE_QTREACTOR_HAS_DLL 1
-#endif /* ! ACE_QTREACTOR_HAS_DLL */
-
-#if defined (ACE_QTREACTOR_HAS_DLL) && (ACE_QTREACTOR_HAS_DLL == 1)
-# if defined (ACE_QTREACTOR_BUILD_DLL)
-# define ACE_QtReactor_Export ACE_Proper_Export_Flag
-# define ACE_QTREACTOR_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
-# define ACE_QTREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
-# else /* ACE_QTREACTOR_BUILD_DLL */
-# define ACE_QtReactor_Export ACE_Proper_Import_Flag
-# define ACE_QTREACTOR_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
-# define ACE_QTREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
-# endif /* ACE_QTREACTOR_BUILD_DLL */
-#else /* ACE_QTREACTOR_HAS_DLL == 1 */
-# define ACE_QtReactor_Export
-# define ACE_QTREACTOR_SINGLETON_DECLARATION(T)
-# define ACE_QTREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
-#endif /* ACE_QTREACTOR_HAS_DLL == 1 */
-
-// Set ACE_QTREACTOR_NTRACE = 0 to turn on library specific tracing even if
-// tracing is turned off for ACE.
-#if !defined (ACE_QTREACTOR_NTRACE)
-# if (ACE_NTRACE == 1)
-# define ACE_QTREACTOR_NTRACE 1
-# else /* (ACE_NTRACE == 1) */
-# define ACE_QTREACTOR_NTRACE 0
-# endif /* (ACE_NTRACE == 1) */
-#endif /* !ACE_QTREACTOR_NTRACE */
-
-#if (ACE_QTREACTOR_NTRACE == 1)
-# define ACE_QTREACTOR_TRACE(X)
-#else /* (ACE_QTREACTOR_NTRACE == 1) */
-# if !defined (ACE_HAS_TRACE)
-# define ACE_HAS_TRACE
-# endif /* ACE_HAS_TRACE */
-# define ACE_QTREACTOR_TRACE(X) ACE_TRACE_IMPL(X)
-# include "ace/Trace.h"
-#endif /* (ACE_QTREACTOR_NTRACE == 1) */
-
-#endif /* ACE_QTREACTOR_EXPORT_H */
-
-// End of auto generated file.
diff --git a/ACE/ace/QtReactor/QtReactor.cpp b/ACE/ace/QtReactor/QtReactor.cpp
deleted file mode 100644
index 5a80886174b..00000000000
--- a/ACE/ace/QtReactor/QtReactor.cpp
+++ /dev/null
@@ -1,644 +0,0 @@
-//$Id$
-
-#include "ace/QtReactor/QtReactor.h"
-
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-
-ACE_ALLOC_HOOK_DEFINE (ACE_QtReactor)
-
-// Must be called with lock held
-
-ACE_QtReactor::ACE_QtReactor (QApplication *qapp ,
- ACE_Sig_Handler *sh,
- ACE_Timer_Queue *tq,
- int disable_notify_pipe,
- ACE_Reactor_Notify *notify,
- int mask_signals,
- int s_queue ):
- ACE_Select_Reactor( sh, tq, disable_notify_pipe,
- notify, mask_signals, s_queue),
- qapp_(qapp),
- qtime_ (0)
-{
- reopen_notification_pipe();
-}
-
-// Must be called with lock held
-ACE_QtReactor::ACE_QtReactor (size_t size,
- QApplication *qapp,
- int restart,
- ACE_Sig_Handler *sh,
- ACE_Timer_Queue *tq,
- int disable_notify_pipe,
- ACE_Reactor_Notify *notify,
- int mask_signals,
- int s_queue):
- ACE_Select_Reactor( size, restart, sh, tq,
- disable_notify_pipe, notify, mask_signals,
- s_queue ),
- qapp_(qapp),
- qtime_ (0)
-
-{
- reopen_notification_pipe();
-}
-
-void ACE_QtReactor::reopen_notification_pipe( void)
-{
- // When the ACE_Select_Reactor is constructed it creates the notify
- // pipe and registers it with the register_handler_i() method. The
- // QtReactor overloads this method BUT because the
- // register_handler_i occurs when constructing the base class
- // ACE_Select_Reactor, the ACE_Select_Reactor register_handler_i()
- // is called not the QtReactor register_handler_i(). This means
- // that the notify pipe is registered with the ACE_Select_Reactor
- // event handling code not the QtReactor and so notfications don't
- // work. To get around this we simply close and re-opened the
- // notification handler in the constructor of the QtReactor.
-
-#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
- if ( initialized_ )
- {
- this->notify_handler_->close ();
-
- // Patch for MS Windows: close and open doesn't clear the read
- // fd_set, so reset it manually
- this->wait_set_.rd_mask_.reset ();
-
- this->notify_handler_->open (this, 0);
- }
-#endif /* ACE_MT_SAFE */
-}
-
-ACE_QtReactor::~ACE_QtReactor (void)
-{
- // iterate over QSocketNotifiers for read and release them
- MAP::ITERATOR iter = this->read_notifier_.begin ();
- MAP::ITERATOR iterEnd = this->read_notifier_.end ();
- while( iter != iterEnd )
- {
- MAP::ENTRY &entry = *iter;
- // QOBject destructor notifies qapplication (hopefully) on delete
- delete entry.int_id_;
- ++iter;
- }
-
- // iterate over QSocketNotifiers for write and release them
- this->write_notifier_.begin ();
- this->write_notifier_.end ();
- while( iter != iterEnd )
- {
- MAP::ENTRY &entry = *iter;
- // QOBject destructor notifies qapplication (hopefully) on delete
- delete entry.int_id_;
- ++iter;
- }
-
- // iterate over QSocketNotifiers for exceptions and release them
- this->exception_notifier_.begin ();
- this->exception_notifier_.end ();
- while( iter != iterEnd )
- {
- MAP::ENTRY &entry = *iter;
- // QOBject destructor notifies qapplication (hopefully) on delete
- delete entry.int_id_;
- ++iter;
- }
-
- // QOBject destructor notifies qapplication (hopefully) on delete
- delete qtime_;
-}
-
-void
-ACE_QtReactor::qapplication (QApplication *qapp)
-{
- // reparent QSocketNotifiers and QTimer
- qapp_ = qapp ;
-}
-
-void
-ACE_QtReactor::timeout_event (void)
-{
- // Deal with any timer events
- ACE_Select_Reactor_Handle_Set handle_set;
- this->dispatch (0, handle_set );
-
- // Set next timeout signal
- this->reset_timeout ();
-}
-
-void
-ACE_QtReactor::read_event (int p_handle)
-{
- ACE_TRACE ("ACE_QtReactor::read_event");
-
- ACE_HANDLE handle = ACE_HANDLE( p_handle );
-
-#ifdef ACE_QTREACTOR_CLEAR_PENDING_EVENTS
- // disable socket notifier to clear pending events
- QSocketNotifier *qsock_notifier = 0;
- if ( ( this->read_notifier_.find( handle,
- qsock_notifier) != -1) )
- qsock_notifier->setEnabled( false );
-#endif /* ACE_QTREACTOR_CLEAR_PENDING_EVENTS */
-
- // The core of read event handling
- ACE_Select_Reactor_Handle_Set dispatch_set;
-
- dispatch_set.rd_mask_.set_bit ( handle );
- this->dispatch (1, dispatch_set);
-
-#ifdef ACE_QTREACTOR_CLEAR_PENDING_EVENTS
- // enable socket notifier according to current mask
- ACE_Reactor_Mask mask = 0;
- mask = mask_ops( handle, mask, ACE_Reactor::GET_MASK );
- if ( -1 != mask )
- set_enable_flag_by_mask ( 1, handle, mask);
-#endif /* ACE_QTREACTOR_CLEAR_PENDING_EVENTS */
-}
-
-void
-ACE_QtReactor::write_event (int p_handle)
-{
- ACE_TRACE ("ACE_QtReactor::write_event");
-
- ACE_HANDLE handle = ACE_HANDLE( p_handle );
-
-#ifdef ACE_QTREACTOR_CLEAR_PENDING_EVENTS
- // disable socket notifier to clear pending events
- QSocketNotifier *qsock_notifier = 0;
- if ( ( this->write_notifier_.find( handle, qsock_notifier) != -1) )
- qsock_notifier->setEnabled( false );
-#endif /* ACE_QTREACTOR_CLEAR_PENDING_EVENTS */
-
- // The core of write event handling
- ACE_Select_Reactor_Handle_Set dispatch_set;
-
- dispatch_set.wr_mask_.set_bit( handle );
- this->dispatch (1, dispatch_set);
-
-#ifdef ACE_QTREACTOR_CLEAR_PENDING_EVENTS
- // enable socket notifier according to current mask
- ACE_Reactor_Mask mask = 0;
- mask = mask_ops( handle, mask, ACE_Reactor::GET_MASK );
- if ( -1 != mask )
- set_enable_flag_by_mask ( 1, handle, mask);
-#endif /* ACE_QTREACTOR_CLEAR_PENDING_EVENTS */
-}
-
-void
-ACE_QtReactor::exception_event (int p_handle)
-{
- ACE_TRACE ("ACE_QtReactor::exception_event");
-
- ACE_HANDLE handle = ACE_HANDLE( p_handle );
-
-
-#ifdef ACE_QTREACTOR_CLEAR_PENDING_EVENTS
- // disable socket notifier to clear pending events
- QSocketNotifier *qsock_notifier = 0;
- if ( ( this->exception_notifier_.find( handle, qsock_notifier) != -1) )
- qsock_notifier->setEnabled( false );
-#endif /* ACE_QTREACTOR_CLEAR_PENDING_EVENTS */
-
- // The core of exception event handling
- ACE_Select_Reactor_Handle_Set dispatch_set;
-
- dispatch_set.ex_mask_.set_bit( handle );
- dispatch (1, dispatch_set);
-
-#ifdef ACE_QTREACTOR_CLEAR_PENDING_EVENTS
- // enable socket notifier according to current mask
- ACE_Reactor_Mask mask = 0;
- mask = mask_ops( handle, mask, ACE_Reactor::GET_MASK );
- if ( -1 != mask )
- set_enable_flag_by_mask ( 1, handle, mask);
-#endif /* ACE_QTREACTOR_CLEAR_PENDING_EVENTS */
-}
-
-int
-ACE_QtReactor::set_enable_flag_by_mask (int flag_value,
- ACE_HANDLE handle,
- ACE_Reactor_Mask mask)
-{
- QSocketNotifier *qs_not;
-
- if (ACE_BIT_ENABLED(mask, ACE_Event_Handler::READ_MASK) ||
- ACE_BIT_ENABLED( mask, ACE_Event_Handler::ACCEPT_MASK))
- {
- // Find the current notifier
- qs_not = 0;
- if ((this->read_notifier_.find (handle, qs_not) == -1))
- return -1;
-
- qs_not->setEnabled (flag_value);
- }
-
- if (ACE_BIT_ENABLED( mask, ACE_Event_Handler::WRITE_MASK) ||
- ACE_BIT_ENABLED( mask, ACE_Event_Handler::ACCEPT_MASK) ||
- ACE_BIT_ENABLED( mask, ACE_Event_Handler::CONNECT_MASK))
- {
- qs_not = 0;
- if ((this->write_notifier_.find (handle, qs_not) == -1))
- return -1;
-
- qs_not->setEnabled (flag_value);
- }
-
- if (ACE_BIT_ENABLED( mask,
- ACE_Event_Handler::EXCEPT_MASK))
- {
- qs_not = 0;
- if ((this->exception_notifier_.find (handle, qs_not) == -1))
- return -1;
-
- qs_not->setEnabled (flag_value);
- }
-
- return 0;
-}
-
-int
-ACE_QtReactor::bit_ops (ACE_HANDLE handle,
- ACE_Reactor_Mask mask,
- ACE_Select_Reactor_Handle_Set &handle_set,
- int ops)
-{
- int result;
- ACE_Select_Reactor_Handle_Set preserved_handle_set = handle_set;
-
- // Call regular bit_ops
- if ((result = ACE_Select_Reactor::bit_ops (handle, mask, handle_set, ops)) == -1)
- return -1;
-
- // disable or enable the notifiers based on handle_set and mask
- int enableFlag = -1;
- if (&handle_set == &this->suspend_set_)
- enableFlag = 0;
- else if (&handle_set == &this->wait_set_)
- enableFlag = 1;
- else
- // We have no work to do here, so just return
- return result;
-
- switch (ops)
- {
- case ACE_Reactor::SET_MASK:
- case ACE_Reactor::ADD_MASK:
- // Enable or disable notifiers based on the specified masks
- if (this->set_enable_flag_by_mask (enableFlag, handle, mask) == -1)
- {
- // We can't just return -1 here because we'll have half-changed things.
- // So, we need to restore the old handle_set, then return -1.
- handle_set = preserved_handle_set;
- return -1;
- }
- break;
-
- case ACE_Reactor::CLR_MASK:
- if (this->set_enable_flag_by_mask (!enableFlag, handle, mask) == -1)
- {
- handle_set = preserved_handle_set;
- return -1;
- }
- break;
-
- default:
- // we take no action for any other operations
- break;
- }
-
- return result;
-}
-
-void
-ACE_QtReactor::create_notifiers_for_handle (ACE_HANDLE handle)
-{
- QSocketNotifier *qsock_notifier = 0;
-
- // if there is already a read socket notifier for this handle, do nothing
- // otherwise create read notifier
- if ( ( this->read_notifier_.find (handle,
- qsock_notifier) == -1) )
- {
- ACE_NEW (qsock_notifier,
- QSocketNotifier (int(handle), QSocketNotifier::Read, this));
- this->read_notifier_.bind (handle,
- qsock_notifier);
- QObject::connect (qsock_notifier,
- SIGNAL (activated (int)),
- this,
- SLOT (read_event (int))) ;
- // disable; it will be enabled by the regular register_handler_i if
- // necessary
- qsock_notifier->setEnabled (0);
- }
-
- qsock_notifier = 0;
-
-
- // if there is already a write socket notifier for this handle, do nothing
- // otherwise create read notifier
- if ((this->write_notifier_.find (handle,
- qsock_notifier) == -1))
- {
- ACE_NEW (qsock_notifier,
- QSocketNotifier (int(handle), QSocketNotifier::Write, this));
-
- this->write_notifier_.bind (handle,
- qsock_notifier);
-
- QObject::connect (qsock_notifier,
- SIGNAL (activated (int)),
- this,
- SLOT (write_event (int)));
- // disable; it will be enabled by the regular register_handler_i if
- // necessary
- qsock_notifier->setEnabled (0);
- }
-
-
- qsock_notifier = 0;
-
- // if there is already a write socket notifier for this handle, do nothing
- // otherwise create read notifier
- if ((this->exception_notifier_.find (handle,
- qsock_notifier) == -1))
- {
-
- ACE_NEW (qsock_notifier,
- QSocketNotifier (int(handle), QSocketNotifier::Exception, this));
-
- this->exception_notifier_.bind (handle,
- qsock_notifier);
-
- QObject::connect (qsock_notifier,
- SIGNAL (activated (int)),
- this,
- SLOT (exception_event (int))) ;
- // disable; it will be enabled by the regular register_handler_i if
- // necessary
- qsock_notifier->setEnabled (0);
- }
-}
-
-void
-ACE_QtReactor::destroy_notifiers_for_handle (ACE_HANDLE handle)
-{
- QSocketNotifier *qsock_notifier = 0;
-
- // Looks for the handle in the maps and removes them.
-
- if ((this->read_notifier_.find (handle,
- qsock_notifier) != -1))
- {
- this->read_notifier_.unbind (handle,
- qsock_notifier);
- delete qsock_notifier;
- }
-
- if ((this->write_notifier_.find (handle,
- qsock_notifier) != -1))
- {
- this->write_notifier_.unbind (handle,
- qsock_notifier);
- delete qsock_notifier;
- }
-
-
- if ((this->exception_notifier_.find (handle,
- qsock_notifier) != -1))
- {
- this->exception_notifier_.unbind (handle,
- qsock_notifier);
- delete qsock_notifier;
- }
-}
-
-int
-ACE_QtReactor::register_handler_i (ACE_HANDLE handle ,
- ACE_Event_Handler *handler,
- ACE_Reactor_Mask mask)
-{
- ACE_TRACE ("ACE_QtReactor::register_handler_i");
-
- this->create_notifiers_for_handle (handle);
-
- int result;
- if ((result = ACE_Select_Reactor::register_handler_i(handle,
- handler,
- mask ))
- == -1)
- {
- // destroy notifiers only when there is no handler for handle
- if ( !ACE_Select_Reactor::find_handler( handle ) )
- this->destroy_notifiers_for_handle (handle);
- return -1;
- }
-
- return 0;
-}
-
-int
-ACE_QtReactor::register_handler_i (const ACE_Handle_Set &handles,
- ACE_Event_Handler *handler,
- ACE_Reactor_Mask mask)
-{
- return ACE_Select_Reactor::register_handler_i(handles,
- handler,
- mask);
-}
-
-int ACE_QtReactor::remove_handler_i (ACE_HANDLE handle ,
- ACE_Reactor_Mask mask )
-{
- ACE_TRACE ("ACE_QtReactor::remove_handler_i");
-
- int result = ACE_Select_Reactor::remove_handler_i (handle, mask);
- // destroy notifiers only when there is no handler for handle
- if ( !ACE_Select_Reactor::find_handler( handle ) )
- this->destroy_notifiers_for_handle (handle);
- return result;
-}
-
-
-int
-ACE_QtReactor::remove_handler_i (const ACE_Handle_Set &handles,
- ACE_Reactor_Mask mask)
-{
- return ACE_Select_Reactor::remove_handler_i (handles,
- mask);
-}
-
-// The following functions ensure that there is an Qt timeout for the
-// first timeout in the Reactor's Timer_Queue.
-
-void
-ACE_QtReactor::reset_timeout (void)
-{
- if (this->qtime_ != 0)
- {
- delete this->qtime_;
- this->qtime_ = 0;
- }
-
- ACE_Time_Value *max_wait_time =
- this->timer_queue_->calculate_timeout (0) ;
-
- if (max_wait_time)
- {
- ACE_NEW (this->qtime_,
- QTimer);
-
- QObject::connect (qtime_,
- SIGNAL (timeout ()),
- this,
- SLOT (timeout_event ()));
-
-#if QT_VERSION >= 0x040000
- qtime_->setSingleShot (1);
- qtime_->start(max_wait_time->msec());
-#else
- qtime_->start(max_wait_time->msec(), 1);
-#endif
- }
-
-}
-
-
-long
-ACE_QtReactor::schedule_timer (ACE_Event_Handler *handler,
- const void *arg,
- const ACE_Time_Value &delay_time,
- const ACE_Time_Value &interval)
-{
- ACE_TRACE ("ACE_QtReactor::schedule_timer");
- ACE_MT (ACE_GUARD_RETURN (ACE_Select_Reactor_Token,
- ace_mon,
- this->token_,
- -1));
-
- long result;
- if ((result = ACE_Select_Reactor::schedule_timer(handler,
- arg,
- delay_time,
- interval)) == -1 )
- return -1;
- else
- {
- this->reset_timeout ();
- return result;
- }
-}
-
-int
-ACE_QtReactor::cancel_timer (ACE_Event_Handler *handler,
- int dont_call_handle_close)
-{
- ACE_TRACE ("ACE_QtReactor::cancel_timer");
-
- if (ACE_Select_Reactor::cancel_timer (handler,
- dont_call_handle_close ) == -1 )
- return -1 ;
- else
- {
- this->reset_timeout( ) ;
- return 0 ;
- }
-}
-
-int ACE_QtReactor::cancel_timer (long timer_id,
- const void **arg,
- int dont_call_handle_close )
-{
- ACE_TRACE ("ACE_QtReactor::cancel_timer") ;
-
- if (ACE_Select_Reactor::cancel_timer (timer_id,
- arg,
- dont_call_handle_close ) == -1 )
- return -1 ;
- else
- {
- this->reset_timeout( ) ;
- return 0 ;
- }
-}
-
-// mbrudka: who needs QtWaitForMultipleEvents? It seems it's cargo load now!
-int
-ACE_QtReactor::QtWaitForMultipleEvents (int width,
- ACE_Select_Reactor_Handle_Set &wait_set,
- ACE_Time_Value * /*max_wait_time*/)
-{
- // Keep a copy of the wait set in case the wait_set be changed
- // between the two select calls in this function. It could happen
- // while waiting for an event, another event is handled and dispatched
- // which changes the dispatch_set_/wait_set.
- ACE_Select_Reactor_Handle_Set orig_wait_set = wait_set;
-
- // Check to make sure our handle's are all usable.
- ACE_Select_Reactor_Handle_Set temp_set = wait_set;
-
- if (ACE_OS::select (width,
- temp_set.rd_mask_,
- temp_set.wr_mask_,
- temp_set.ex_mask_,
- (ACE_Time_Value *) &ACE_Time_Value::zero ) == -1)
- return -1; // Bad file arguments...
-
- // Qt processing.
-#if QT_VERSION >= 0x040000
- this->qapp_->processEvents();
-#else
- this->qapp_->processOneEvent ();
-#endif
-
- // Reset the width, in case it changed during the upcalls.
- width = handler_rep_.max_handlep1 ();
-
- // Now actually read the result needed by the <Select_Reactor> using
- // <select>.
- return ACE_OS::select(width,
- orig_wait_set.rd_mask_,
- orig_wait_set.wr_mask_,
- orig_wait_set.ex_mask_,
- (ACE_Time_Value *) &ACE_Time_Value::zero);
-}
-
-// mbrudka: who needs wait_for_multiple_events? It seems it's cargo load now!
-int
-ACE_QtReactor::wait_for_multiple_events (
- ACE_Select_Reactor_Handle_Set &handle_set,
- ACE_Time_Value *max_wait_time)
-{
- ACE_TRACE ("ACE_QtReactor::wait_for_multiple_events");
-
- int nfound = 0;
- do
- {
- max_wait_time = this->timer_queue_->calculate_timeout (max_wait_time);
- size_t width = this->handler_rep_.max_handlep1 ();
- handle_set.rd_mask_ = this->wait_set_.rd_mask_;
- handle_set.wr_mask_ = this->wait_set_.wr_mask_;
- handle_set.ex_mask_ = this->wait_set_.ex_mask_;
-
- nfound = QtWaitForMultipleEvents (width,
- handle_set,
- max_wait_time);
-
- } while( nfound == -1 && this->handle_error () > 0 );
-
- if (nfound > 0)
- {
-#if !defined (ACE_WIN32)
- handle_set.rd_mask_.sync (this->handler_rep_.max_handlep1 ());
- handle_set.wr_mask_.sync (this->handler_rep_.max_handlep1 ());
- handle_set.ex_mask_.sync (this->handler_rep_.max_handlep1 ());
-#endif /* ACE_WIN32 */
- }
-
- return nfound;
- // Timed out or input available
-}
-
-ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/ACE/ace/QtReactor/QtReactor.h b/ACE/ace/QtReactor/QtReactor.h
deleted file mode 100644
index 279516e38e6..00000000000
--- a/ACE/ace/QtReactor/QtReactor.h
+++ /dev/null
@@ -1,231 +0,0 @@
-// -*- C++ -*-
-
-//=============================================================================
-/**
- * @file QtReactor.h
- *
- * $Id$
- *
- * @author Hamish Friedlander <ullexco@wave.co.nz>
- * @author Balachandran Natarajan <bala@cs.wustl.edu>
- */
-//=============================================================================
-
-#ifndef ACE_QTREACTOR_H
-#define ACE_QTREACTOR_H
-
-#include /**/ "ace/pre.h"
-
-#include "ace/QtReactor/ACE_QtReactor_export.h"
-
-#if !defined (ACE_LACKS_PRAGMA_ONCE)
-# pragma once
-#endif /* ACE_LACKS_PRAGMA_ONCE */
-
-#include "ace/Select_Reactor.h"
-#include "ace/Map_Manager.h"
-
-#include "qglobal.h"
-
-// QT toolkit specific includes.
-#if QT_VERSION >= 0x040000
-#include /**/ <QtGui/QApplication>
-#include /**/ <QtCore/QObject>
-#include /**/ <QtCore/QSocketNotifier.h>
-#include /**/ <QtCore/QTimer.h>
-#else
-#include /**/ <qapplication.h>
-#include /**/ <qobject.h>
-#include /**/ <qsocketnotifier.h>
-#include /**/ <qtimer.h>
-#endif
-
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-
-/**
- * @class ACE_QtReactor
- *
- * @brief An object-oriented event demultiplexor and event handler
- * dispatcher that uses the Qt Library. This class declaration
- * also uses the extension facilities provided by the Qt. So,
- * readers of the class declaration should not be upset with
- * the appearence of the Keywords like Q_OBJECT, private slots
- * etc. They are specific to Qt which uses these as a call back
- * methods implementation mechanism.
- *
- * \note Marek Brudka <mbrudka@elka.pw.edu.pl>: ACE_QtReactor was
- * quickly bugfixed to meet ACE 5.4.2 (6.0.0?) deadline.
- * While it passes QtReactor_Test now, there is a great
- * room for improvements as the implementation is rather inefficient
- * and obfuscated
- * To be more specific:
- * - reset_timeout always creates and removes qtimer after each
- * timeout event! Obviously, for fast triggering timers this may
- * lead to excessive memory management.
- * - create/destroy_notifiers_for_handle may also be reworked to
- * establish more clean relations between handles and QSocketNotifiers.
- * - read/write_exception_event disable now SocketNotifier for a while
- * to clear pending events. The cost of this operation is high: two hash
- * acces in ACE and at least two next ones in Qt. This makes QtReator slow,
- * but how clear pending events another way ?
- * - there is qapplication() mutator, which sets new qapplication for
- * QtReactor. This mutator violates implicit assumption about the
- * relations between QTimer and QSocketNotifiers and QApplication for
- * this reactor, namely one may expect that after qapplication(), none
- * of QtReactor artifacts is bound to old qapplication. That's not true
- * now, as QTimer and QSocketNotifiers are not reparent to new
- * QApplication. As a result, the sequence:
- * QApplication *old_qapp = new QApplication(..);
- * QtReactor qreactor( old_qapp);
- * // .. register handlers, schedule_timers etc
- * QApplication *new_qapp = new QApplication(..);
- * qreactor.qpplication( new_qapp );
- * delete old_qapp;
- * almost always leads to problems and memory violation, because
- * QSocketNotifiers are released by old_qapp. Therefore QtReactor
- * should not be reparent now by setting new qapplication.
- * - the lifecycle of Qt objects in ACE contects is rather mysterious
- * and should be made more explicit.
- * - valgrind reports a small memory leak in QtReactor_Test, though as for now
- * it is not clear if the leak is introduced by QtReactor, or rather incorrect
- * memory management in QtReactor_Test.
- */
-class ACE_QtReactor_Export ACE_QtReactor
- : public QObject,
- public ACE_Select_Reactor
-{
-
- Q_OBJECT
-
-public:
- /** \brief Constructor follows @ACE_Select_Reactor
- \param QApplication *qapp, qapplication which runs events loop
- */
- ACE_QtReactor (QApplication *qapp = 0,
- ACE_Sig_Handler * = 0,
- ACE_Timer_Queue * = 0,
- int disable_notify_pipe = 0,
- ACE_Reactor_Notify *notify = 0,
- int mask_signals = 1,
- int s_queue = ACE_SELECT_TOKEN::FIFO);
-
- /** \brief Constructor follows @ACE_Select_Reactor
- \param QApplication *qapp, qapplication which runs events loop
- */
- ACE_QtReactor (size_t size,
- QApplication *qapp = 0,
- int restart = 0,
- ACE_Sig_Handler * = 0,
- ACE_Timer_Queue * = 0,
- int disable_notify_pipe = 0,
- ACE_Reactor_Notify *notify = 0,
- int mask_signals = 1,
- int s_queue = ACE_SELECT_TOKEN::FIFO);
-
- virtual ~ACE_QtReactor (void);
-
- void qapplication (QApplication *qapp);
-
- // = Timer operations.
- virtual long schedule_timer (ACE_Event_Handler *handler,
- const void *arg,
- const ACE_Time_Value &delay_time,
- const ACE_Time_Value &interval);
-
- virtual int cancel_timer (ACE_Event_Handler *handler,
- int dont_call_handle_close = 1);
-
- virtual int cancel_timer (long timer_id,
- const void **arg = 0,
- int dont_call_handle_close = 1);
-
-protected:
-
- // = Register timers/handles with Qt
-
- /// Register a single @a handler.
- virtual int register_handler_i (ACE_HANDLE handle,
- ACE_Event_Handler *handler,
- ACE_Reactor_Mask mask);
-
- /// Register a set of <handlers> with Qt.
- virtual int register_handler_i (const ACE_Handle_Set &handles,
- ACE_Event_Handler *handler,
- ACE_Reactor_Mask mask);
-
-
- /// Remove the <handler> associated with this @a handle.
- virtual int remove_handler_i (ACE_HANDLE handle,
- ACE_Reactor_Mask mask);
-
- /// Remove a set of <handles>.
- virtual int remove_handler_i (const ACE_Handle_Set &handles,
- ACE_Reactor_Mask mask);
-
- /// Wait for events to occur.
- virtual int wait_for_multiple_events (ACE_Select_Reactor_Handle_Set &handle_set,
- ACE_Time_Value *max_wait_time);
-
- virtual int QtWaitForMultipleEvents (int width,
- ACE_Select_Reactor_Handle_Set &wait_set,
- ACE_Time_Value *max_wait_time);
-
- virtual int bit_ops (ACE_HANDLE handle,
- ACE_Reactor_Mask mask,
- ACE_Select_Reactor_Handle_Set &handle_set,
- int ops);
-
- int set_enable_flag_by_mask (int flag_value, ACE_HANDLE handle, ACE_Reactor_Mask mask);
- void create_notifiers_for_handle (ACE_HANDLE handle);
- void destroy_notifiers_for_handle (ACE_HANDLE handle);
-
- // Wait for Qt events to occur
-
- /// Some Qt stuff that we need to have
- QApplication *qapp_ ;
-
- /// Typedef of a map.
- typedef ACE_Map_Manager<ACE_HANDLE, QSocketNotifier *, ACE_Null_Mutex> MAP;
-
- /// A notifier for a read
- MAP read_notifier_;
-
- /// A write notifier
- MAP write_notifier_;
-
- /// An exception notifier
- MAP exception_notifier_;
-
- /// The timer class that would provide timer-sgnals & single-shot timers
- QTimer *qtime_ ;
-
-private:
- /// This method ensures there's an Qt timeout for the first timeout
- /// in the Reactor's Timer_Queue.
- void reset_timeout (void);
- /// reopens notification pipe to create SocketNotifier for it
- void reopen_notification_pipe(void);
- /// Deny access since member-wise won't work...
- ACE_QtReactor (const ACE_QtReactor &);
- ACE_QtReactor &operator= (const ACE_QtReactor &);
-
-private slots:
-
- // These are all part of the communication mechanism adopted in Qt.
- /// Dispatch a Read Event
- void read_event (int FD);
-
- /// Dispatch a Write Event
- void write_event (int FD);
-
- /// Dispatch an exception event
- void exception_event (int FD);
-
- /// Dispach a timeout event
- void timeout_event (void);
-};
-
-ACE_END_VERSIONED_NAMESPACE_DECL
-
-#include /**/ "ace/post.h"
-#endif /* ACE_QTREACTOR_H */