Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Acceptor_Impl.h
blob789d371b91d93199033c3154a8c4728def166673
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Acceptor_Impl.h
7 * @author Carlos O'Ryan <coryan@cs.wustl.edu>
8 * @author Ossama Othman <othman@cs.wustl.edu>
9 */
10 //=============================================================================
12 #ifndef TAO_ACCEPTOR_IMPL_H
13 #define TAO_ACCEPTOR_IMPL_H
15 #include /**/ "ace/pre.h"
17 #include "ace/Strategies_T.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 # pragma once
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #include "tao/Basic_Types.h"
25 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
27 // Forward declarations.
28 class TAO_ORB_Core;
30 /**
31 * @class TAO_Creation_Strategy
33 * @brief Creates a Svc_Handler and set the ORB_Core pointer on it.
35 template <class SVC_HANDLER>
36 class TAO_Creation_Strategy : public ACE_Creation_Strategy<SVC_HANDLER>
38 public:
39 /**
40 * Constructor.
42 TAO_Creation_Strategy (TAO_ORB_Core *orb_core);
44 /// Create a SVC_HANDLER and set the ORB_Core pointer on it.
45 int make_svc_handler (SVC_HANDLER *&sh);
47 protected:
48 /// Pointer to the ORB Core.
49 TAO_ORB_Core *orb_core_;
52 /**
53 * @class TAO_Concurrency_Strategy
55 * @brief Activates the Svc_Handler, and then if specified by the
56 * TAO_Server_Strategy_Factory, it activates the Svc_Handler to
57 * run in its own thread.
59 template <class SVC_HANDLER>
60 class TAO_Concurrency_Strategy : public ACE_Concurrency_Strategy<SVC_HANDLER>
62 public:
63 /// Constructor.
64 TAO_Concurrency_Strategy (TAO_ORB_Core *orb_core);
66 /**
67 * Activates the Svc_Handler, and then if specified by the
68 * TAO_Server_Strategy_Factory, it activates the Svc_Handler to run
69 * in its own thread.
71 int activate_svc_handler (SVC_HANDLER *svc_handler, void *arg);
73 protected:
74 /// Pointer to the ORB Core.
75 TAO_ORB_Core *orb_core_;
78 template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1>
79 class TAO_Accept_Strategy : public ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>
81 public:
82 /// Constructor.
83 TAO_Accept_Strategy (TAO_ORB_Core *orb_core);
85 /// Initialize the <peer_acceptor_> with @a local_addr. If the
86 /// process runs out of handles, purge some "old" connections.
87 int open (const ACE_PEER_ACCEPTOR_ADDR &local_addr,
88 bool restart = false);
90 /// Delegates to the <accept> method of the PEER_ACCEPTOR. If the
91 /// process runs out of handles, purge some "old" connections.
92 int accept_svc_handler (SVC_HANDLER *svc_handler);
94 protected:
95 /// Base class.
96 typedef ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2> ACCEPT_STRATEGY_BASE;
98 /// Pointer to the ORB Core.
99 TAO_ORB_Core *orb_core_;
102 TAO_END_VERSIONED_NAMESPACE_DECL
104 #include "tao/Acceptor_Impl.cpp"
106 #include /**/ "ace/post.h"
107 #endif /* TAO_ACCEPTOR_IMPL_H */