diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 2013-04-24 15:01:48 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 2013-04-24 15:01:48 +0000 |
commit | 4197b1898b4319904f38397662656079af8d945b (patch) | |
tree | c506664051fc00b667c8be8ea6f917ff893ac1e6 /ACE/ace/Svc_Handler.h | |
parent | 85fe74ccaac59923bc6a39e31fdbb16974028a42 (diff) | |
download | ATCD-4197b1898b4319904f38397662656079af8d945b.tar.gz |
ChangeLogTag:Wed
Diffstat (limited to 'ACE/ace/Svc_Handler.h')
-rw-r--r-- | ACE/ace/Svc_Handler.h | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/ACE/ace/Svc_Handler.h b/ACE/ace/Svc_Handler.h index 741e6102e95..5a8fbbfa9fe 100644 --- a/ACE/ace/Svc_Handler.h +++ b/ACE/ace/Svc_Handler.h @@ -53,14 +53,14 @@ enum ACE_Svc_Handler_Close { NORMAL_CLOSE_OPERATION = 0x00, * This endpoint is used to exchange data between a * ACE_Svc_Handler and the peer it is connected with. */ -template <ACE_PEER_STREAM_1, ACE_SYNCH_DECL> -class ACE_Svc_Handler : public ACE_Task<ACE_SYNCH_USE> +template <typename PEER_STREAM, typename SYNCH_TRAITS> +class ACE_Svc_Handler : public ACE_Task<SYNCH_TRAITS> { public: // Useful STL-style traits. - typedef ACE_PEER_STREAM_ADDR addr_type; - typedef ACE_PEER_STREAM stream_type; + typedef typename PEER_STREAM::PEER_ADDR addr_type; + typedef PEER_STREAM stream_type; /** * Constructor initializes the @a thr_mgr and @a mq by passing them @@ -68,15 +68,17 @@ public: * the ACE_Event_Handler. */ ACE_Svc_Handler (ACE_Thread_Manager *thr_mgr = 0, - ACE_Message_Queue<ACE_SYNCH_USE> *mq = 0, + ACE_Message_Queue<SYNCH_TRAITS> *mq = 0, ACE_Reactor *reactor = ACE_Reactor::instance ()); /// Destructor. virtual ~ACE_Svc_Handler (void); /// Activate the client handler. This is typically called by the - /// ACE_Acceptor or ACE_Connector. - virtual int open (void * = 0); + /// ACE_Acceptor or ACE_Connector, which passes "this" in as the + /// parameter to open. If this method returns -1 the Svc_Handler's + /// close() method is automatically called. + virtual int open (void *acceptor_or_connector = 0); /** * Object termination hook -- application-specific cleanup code goes @@ -148,8 +150,8 @@ public: virtual void set_handle (ACE_HANDLE); /// Returns the underlying PEER_STREAM. Used by - /// <ACE_Acceptor::accept> and <ACE_Connector::connect> factories - ACE_PEER_STREAM &peer (void) const; + /// <ACE_Acceptor::accept> and <ACE_Connector::connect> factories. + PEER_STREAM &peer (void) const; /// Overloaded new operator. This method unobtrusively records if a /// <Svc_Handler> is allocated dynamically, which allows it to clean @@ -234,7 +236,7 @@ public: protected: /// Maintain connection with client. - ACE_PEER_STREAM peer_; + PEER_STREAM peer_; /// Have we been dynamically created? bool dynamic_; @@ -262,8 +264,8 @@ protected: * queue is "full" or (2) a period of time elapses, at which * point the queue is "flushed" via <sendv_n> to the peer. */ -template <ACE_PEER_STREAM_1, ACE_SYNCH_DECL> -class ACE_Buffered_Svc_Handler : public ACE_Svc_Handler<ACE_PEER_STREAM_2, ACE_SYNCH_USE> +template <typename PEER_STREAM, typename SYNCH_TRAITS> +class ACE_Buffered_Svc_Handler : public ACE_Svc_Handler<PEER_STREAM, SYNCH_TRAITS> { public: // = Initialization and termination methods. @@ -277,7 +279,7 @@ public: * relative to the current time returned by <ACE_OS::gettimeofday>. */ ACE_Buffered_Svc_Handler (ACE_Thread_Manager *thr_mgr = 0, - ACE_Message_Queue<ACE_SYNCH_USE> *mq = 0, + ACE_Message_Queue<SYNCH_TRAITS> *mq = 0, ACE_Reactor *reactor = ACE_Reactor::instance (), size_t max_buffer_size = 0, ACE_Time_Value *relative_timeout = 0); |