summaryrefslogtreecommitdiff
path: root/ace/Proactor.h
diff options
context:
space:
mode:
authorirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-07-26 18:54:39 +0000
committerirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-07-26 18:54:39 +0000
commit15bc210e1a411ac93b0d2a41e0b898ba16583e05 (patch)
treee08bf39d3f5e4db1b282454d79a053355330fa0d /ace/Proactor.h
parentb5adfd4ffd24551632be96077fe9f519e10bfff7 (diff)
downloadATCD-15bc210e1a411ac93b0d2a41e0b898ba16583e05.tar.gz
*** empty log message ***
Diffstat (limited to 'ace/Proactor.h')
-rw-r--r--ace/Proactor.h75
1 files changed, 60 insertions, 15 deletions
diff --git a/ace/Proactor.h b/ace/Proactor.h
index bab67676b14..5bbabbd1313 100644
--- a/ace/Proactor.h
+++ b/ace/Proactor.h
@@ -139,6 +139,35 @@ public:
virtual ~ACE_Proactor (void);
// Virtual destruction.
+ static ACE_Proactor *instance (size_t threads = 0);
+ // Get pointer to a process-wide <ACE_Proactor>. <threads> should
+ // be part of another method. It's only here because I'm just a
+ // grad student and not in charge. No, I'm not bitter about this.
+
+ static ACE_Proactor *instance (ACE_Proactor *);
+ // Set pointer to a process-wide <ACE_Proactor> and return existing
+ // pointer.
+
+ static void close_singleton (void);
+ // Delete the dynamically allocated Singleton
+
+ // = Proactor event loop management methods.
+ static int run_event_loop (void);
+ // Run the event loop until the <ACE_Proactor::handle_events>
+ // method returns -1 or the <end_event_loop> method
+ // is invoked.
+
+ static int run_event_loop (ACE_Time_Value &tv);
+ // 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.
+
+ static int end_event_loop (void);
+ // Instruct the <ACE_Proactor::instance> to terminate its event loop.
+
+ static sig_atomic_t event_loop_done (void);
+ // Report if the <ACE_Proactor::instance> event loop is finished.
+
virtual int close (void);
// Close the IO completion port
@@ -195,21 +224,6 @@ public:
virtual int handle_events (void);
// Block indefinitely until at least one event is dispatched.
- // = Event loop management methods.
- int run_proactor_event_loop (void);
- // Run the event loop until the this->handle_events returns -1 or
- // the this->end_event_loop is invoked.
-
- int run_event_loop (ACE_Time_Value &tv);
- // Run the event loop until the this->handle_events returns -1, the
- // this->end_event_loop is invoked, or <tv> expires.
-
- int end_event_loop (void);
- // Terminates a this->run_event_loop call.
-
- sig_atomic_t event_loop_done (void);
- // Report if the Proactor's event loop is finished.
-
int wake_up_dispatch_threads (void);
// Add wakeup dispatch threads (reinit).
@@ -304,6 +318,16 @@ protected:
int used_with_reactorEx_event_loop_;
// Flag that indicates whether we are used in conjunction with
// ReactorEx
+
+private:
+ static ACE_Proactor *proactor_;
+ // Pointer to a process-wide <ACE_Proactor>.
+
+ static int delete_proactor_;
+ // Must delete the <proactor_> if non-0.
+
+ static sig_atomic_t end_event_loop_;
+ // Terminate the proactor event loop.
};
#if defined (__ACE_INLINE__)
@@ -320,6 +344,27 @@ public:
Timer_Queue * /* tq */ = 0) {}
virtual int handle_events (void) { return -1; }
virtual int handle_events (ACE_Time_Value &) { return -1; }
+
+ static ACE_Proactor *instance (size_t threads = 0);
+ // Placeholder to enable compilation on non-Win32 platforms
+
+ static ACE_Proactor *instance (ACE_Proactor *);
+ // Placeholder to enable compilation on non-Win32 platforms
+
+ static void close_singleton (void);
+ // Placeholder to enable compilation on non-Win32 platforms
+
+ static int run_event_loop (void);
+ // Placeholder to enable compilation on non-Win32 platforms
+
+ static int run_event_loop (ACE_Time_Value &tv);
+ // Placeholder to enable compilation on non-Win32 platforms
+
+ static int end_event_loop (void);
+ // Placeholder to enable compilation on non-Win32 platforms
+
+ static sig_atomic_t event_loop_done (void);
+ // Placeholder to enable compilation on non-Win32 platforms
};
#endif /* ACE_WIN32 */