Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Strategies / SHMIOP_Acceptor.h
blob853086b1d3e997b03d08aa37b9030af20818b640
1 // -*- C++ -*-
2 // ===================================================================
3 /**
4 * @file SHMIOP_Acceptor.h
6 * @brief SHMIOP specific acceptor processing
8 * @author Nanbor Wang <nanbor@cs.wustl.edu>
9 */
10 // ===================================================================
12 #ifndef TAO_SHMIOP_ACCEPTOR_H
13 #define TAO_SHMIOP_ACCEPTOR_H
15 #include /**/ "ace/pre.h"
17 #include "tao/orbconf.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 # pragma once
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #if defined (TAO_HAS_SHMIOP) && (TAO_HAS_SHMIOP != 0)
25 #include "tao/Transport_Acceptor.h"
26 #include "tao/Strategies/SHMIOP_Connection_Handler.h"
27 #include "tao/Acceptor_Impl.h"
28 #include "ace/Acceptor.h"
29 #include "ace/MEM_Acceptor.h"
30 #include "tao/GIOP_Message_Version.h"
31 // TAO SHMIOP_Acceptor concrete call definitions
33 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
35 /**
36 * @class TAO_SHMIOP_Acceptor
38 * @brief The SHMIOP-specific bridge class for the concrete acceptor.
40 class TAO_Strategies_Export TAO_SHMIOP_Acceptor : public TAO_Acceptor
42 public:
43 /// Constructor.
44 TAO_SHMIOP_Acceptor ();
46 /// Destructor.
47 ~TAO_SHMIOP_Acceptor ();
49 typedef TAO_Strategy_Acceptor<TAO_SHMIOP_Connection_Handler, ACE_MEM_ACCEPTOR> TAO_SHMIOP_BASE_ACCEPTOR;
50 typedef TAO_Creation_Strategy<TAO_SHMIOP_Connection_Handler> TAO_SHMIOP_CREATION_STRATEGY;
51 typedef TAO_Concurrency_Strategy<TAO_SHMIOP_Connection_Handler> TAO_SHMIOP_CONCURRENCY_STRATEGY;
52 typedef TAO_Accept_Strategy<TAO_SHMIOP_Connection_Handler, ACE_MEM_ACCEPTOR> TAO_SHMIOP_ACCEPT_STRATEGY;
54 /**
55 * @name The TAO_Acceptor Methods
57 * Please check the documentation in Transport_Acceptor.h for details.
59 //@{
60 virtual int open (TAO_ORB_Core *orb_core,
61 ACE_Reactor *reactor,
62 int version_major,
63 int version_minor,
64 const char *port,
65 const char *options = 0);
66 virtual int open_default (TAO_ORB_Core *orb_core,
67 ACE_Reactor *reactor,
68 int version_major,
69 int version_minor,
70 const char *options = 0);
71 virtual int close ();
72 virtual int create_profile (const TAO::ObjectKey &object_key,
73 TAO_MProfile &mprofile,
74 CORBA::Short priority);
76 virtual int is_collocated (const TAO_Endpoint* endpoint);
77 virtual CORBA::ULong endpoint_count ();
79 virtual int object_key (IOP::TaggedProfile &profile,
80 TAO::ObjectKey &key);
81 //@}
83 /// Set the MMAP options the MEM_Stream this acceptor creates will
84 /// use.
85 int set_mmap_options (const ACE_TCHAR *prefix,
86 ACE_OFF_T size);
88 private:
89 /// Implement the common part of the open*() methods.
90 int open_i (TAO_ORB_Core* orb_core,
91 ACE_Reactor *reactor);
93 /// Parse protocol specific options.
94 virtual int parse_options (const char *options);
96 /// Create a SHMIOP profile representing this acceptor.
97 int create_new_profile (const TAO::ObjectKey &object_key,
98 TAO_MProfile &mprofile,
99 CORBA::Short priority);
101 /// Add the endpoints on this acceptor to a shared profile.
102 int create_shared_profile (const TAO::ObjectKey &object_key,
103 TAO_MProfile &mprofile,
104 CORBA::Short priority);
106 protected:
107 /// Cache the information about the endpoint serviced by this
108 /// acceptor.
109 /// @todo There may in fact be multiple hostnames for this endpoint.
110 /// For example it the IP address is INADDR_ANY
111 /// (0.0.0.0) then there will be possibly a different hostname for
112 /// each interface.
113 ACE_CString host_;
115 /// A local endpoint.
116 ACE_MEM_Addr address_;
118 /// The GIOP version for this endpoint
119 TAO_GIOP_Message_Version version_;
121 /// ORB Core.
122 TAO_ORB_Core *orb_core_;
124 private:
125 /// The concrete acceptor, as a pointer to it's base class.
126 TAO_SHMIOP_BASE_ACCEPTOR base_acceptor_;
128 /// Acceptor strategies.
129 TAO_SHMIOP_CREATION_STRATEGY *creation_strategy_;
130 TAO_SHMIOP_CONCURRENCY_STRATEGY *concurrency_strategy_;
131 TAO_SHMIOP_ACCEPT_STRATEGY *accept_strategy_;
133 /// Determine the prefix (include path name) of the mmap file.
134 const ACE_TCHAR *mmap_file_prefix_;
136 /// Determine the minimum size of mmap file. This dictate the
137 /// maximum size of a CORBA method invocation.
138 ACE_OFF_T mmap_size_;
141 TAO_END_VERSIONED_NAMESPACE_DECL
143 #endif /* TAO_HAS_SHMIOP && TAO_HAS_SHMIOP != 0 */
145 #include /**/ "ace/post.h"
147 #endif /* TAO_SHMIOP_ACCEPTOR_H */