Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / examples / Service_Configurator / IPC-tests / server / Handle_Thr_Stream.h
blob76c78c9b8ceb6e28d422c653b34bdc47a8bc9c53
1 /* -*- C++ -*- */
2 #ifndef _HANDLE_THR_STREAM_H
3 #define _HANDLE_THR_STREAM_H
5 #include "ace/Acceptor.h"
6 #include "ace/Svc_Handler.h"
8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
12 #include "ace/Service_Types.h"
14 #if defined (ACE_HAS_THREADS)
16 template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1>
17 class Handle_Thr_Acceptor : public ACE_Strategy_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>
18 // = TITLE
19 // This factory creates new <SVC_HANDLERS> and runs them with the
20 // configured <ACE_Thread_Strategy>.
22 public:
23 Handle_Thr_Acceptor ();
24 ~Handle_Thr_Acceptor ();
26 // = Dynamic linking hooks.
27 virtual int init (int argc, ACE_TCHAR *argv[]);
28 virtual int info (ACE_TCHAR **, size_t) const;
29 virtual int fini ();
31 private:
32 ACE_Thread_Manager thr_mgr_;
33 // Thread manager.
35 ACE_Thread_Strategy<SVC_HANDLER> thr_strategy_;
36 // Threading strategy.
38 int thr_flags_;
39 // Threading flags.
42 template <ACE_PEER_STREAM_1>
43 class CLI_Stream : public ACE_Svc_Handler<ACE_PEER_STREAM_2, ACE_MT_SYNCH>
44 // = TITLE
45 // This class interacts with the client, running in a separate
46 // thread and handles connections from remote TCP/IP connections.
48 public:
49 CLI_Stream (ACE_Thread_Manager * = 0);
51 virtual int open (void *);
52 // Open the service.
54 virtual int close (u_long);
55 // Close down the service.
57 virtual int svc ();
58 // Execute the service.
60 protected:
61 typedef ACE_Svc_Handler<ACE_PEER_STREAM_2, ACE_MT_SYNCH> inherited;
64 extern ACE_Service_Object_Type rts;
66 #include "Handle_Thr_Stream.cpp"
67 #endif /* ACE_HAS_THREADS */
68 #endif /* _HANDLE_THR_STREAM_H */