Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / DynamicInterface / DII_Invocation_Adapter.h
blob2e529f0318bc3404608dc7f7cc01e1bed665aa44
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file DII_Invocation_Adapter.h
7 * @author Balachandran Natarajan <bala@dre.vanderbilt.edu>
8 */
9 //=============================================================================
10 #ifndef TAO_DII_INVOCATION_ADAPTER_H
11 #define TAO_DII_INVOCATION_ADAPTER_H
12 #include /**/ "ace/pre.h"
14 #include "tao/DynamicInterface/dynamicinterface_export.h"
16 #if !defined (ACE_LACKS_PRAGMA_ONCE)
17 # pragma once
18 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "tao/Invocation_Adapter.h"
22 #include "tao/Asynch_Reply_Dispatcher_Base.h"
23 #include "tao/DynamicInterface/DII_Reply_Dispatcher.h"
24 #include "ace/Auto_Functor.h"
26 #if defined (TAO_HAS_AMI)
27 #include "tao/Messaging/Messaging.h"
28 #endif /* TAO_HAS_AMI */
30 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
31 class ACE_Time_Value;
32 ACE_END_VERSIONED_NAMESPACE_DECL
35 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
36 class TAO_Operation_Details;
37 class TAO_Stub;
38 class TAO_ORB_Core;
39 namespace CORBA
41 class Object;
42 class ExceptionList;
43 class Request;
46 namespace TAO
48 class Argument;
49 class Collocation_Proxy_Broker;
50 struct Exception_Data;
52 /**
53 * @class DII_Invocation_Adapter
55 * @brief Generic interface for the DII invocation object visible
57 class TAO_DynamicInterface_Export DII_Invocation_Adapter :
58 public Invocation_Adapter
60 public:
61 /// The only constructor used by the IDL compiler and only way to
62 /// create this adapter.
63 /**
65 * @param target Points to the object on which this invocation is
66 * being invoked.
68 * @param args Array of pointers to the argument list in the
69 * operation declaration. this includes the return, inout and out
70 * arguments.
72 * @param arg_number Number of arguments in the above array. This
73 * is the number of elements in the above array.
75 * @param operation The name of the operation being invoked.
77 * @param op_len Number of characters in the operation name. This
78 * is an optimization which helps us to avoid calling strlen ()
79 * while creating a message format.
81 * @param mode Invocation mode. This information is also available
82 * in the IDL file and in the generated code.
84 DII_Invocation_Adapter (CORBA::Object *target,
85 Argument **args,
86 int arg_number,
87 const char *operation,
88 size_t op_len,
89 CORBA::ExceptionList *exception,
90 CORBA::Request *r,
91 Invocation_Mode mode = TAO_DII_INVOCATION);
93 virtual ~DII_Invocation_Adapter ();
95 /// Invoke the target
96 virtual void invoke (const TAO::Exception_Data *ex, unsigned long ex_count);
98 protected:
99 virtual Invocation_Status invoke_twoway (
100 TAO_Operation_Details &op,
101 CORBA::Object_var &effective_target,
102 Profile_Transport_Resolver &r,
103 ACE_Time_Value *&max_wait_time,
104 Invocation_Retry_State *retry_state = 0);
106 virtual Invocation_Status invoke_collocated_i (
107 TAO_Stub *stub,
108 TAO_Operation_Details &details,
109 CORBA::Object_var &effective_target,
110 Collocation_Strategy strat);
112 private:
113 CORBA::ExceptionList *exception_list_;
115 CORBA::Request *request_;
117 TAO::Exception_Data *ex_data_;
118 private:
119 DII_Invocation_Adapter () = delete;
120 DII_Invocation_Adapter (const DII_Invocation_Adapter &) = delete;
121 DII_Invocation_Adapter & operator= (const DII_Invocation_Adapter &) = delete;
125 * @class DII_Deferred_Invocation_Adapter
127 * @brief This class is for deferred DII invocation.
129 class TAO_DynamicInterface_Export DII_Deferred_Invocation_Adapter
130 : public Invocation_Adapter
132 public:
133 DII_Deferred_Invocation_Adapter (
134 CORBA::Object *target,
135 Argument **args,
136 int arg_number,
137 const char *operation,
138 size_t op_len,
139 int collocation_opportunity,
140 TAO_ORB_Core *oc,
141 CORBA::Request *req,
142 TAO::Invocation_Mode mode = TAO_DII_DEFERRED_INVOCATION);
144 /// Invoke the target
145 virtual void invoke (const TAO::Exception_Data *ex, unsigned long ex_count);
147 protected:
148 virtual Invocation_Status invoke_twoway (
149 TAO_Operation_Details &op,
150 CORBA::Object_var &effective_target,
151 Profile_Transport_Resolver &r,
152 ACE_Time_Value *&max_wait_time,
153 Invocation_Retry_State *retry_state = 0);
155 virtual Invocation_Status invoke_collocated_i (
156 TAO_Stub *stub,
157 TAO_Operation_Details &details,
158 CORBA::Object_var &effective_target,
159 Collocation_Strategy strat);
161 private:
162 CORBA::Request *request_;
164 /// Reply dispatcher for the current Invocation.
165 /// Use special autopointer like holder to prevent leaking memory from
166 /// the reply dispatcher that we create.
167 ACE_Utils::Auto_Functor <TAO_DII_Deferred_Reply_Dispatcher,
168 ARDB_Refcount_Functor> rd_;
170 /// Cache the orb_core
171 TAO_ORB_Core * const orb_core_;
175 * @class DII_Oneway_Invocation_Adapter
177 * @brief This class is for oneway DII invocation.
179 class TAO_DynamicInterface_Export DII_Oneway_Invocation_Adapter
180 : public Invocation_Adapter
182 public:
183 DII_Oneway_Invocation_Adapter (
184 CORBA::Object *target,
185 Argument **args,
186 int arg_number,
187 const char *operation,
188 int op_len,
189 TAO::Invocation_Mode mode = TAO_SYNCHRONOUS_INVOCATION);
191 protected:
192 virtual Invocation_Status invoke_collocated_i (
193 TAO_Stub *stub,
194 TAO_Operation_Details &details,
195 CORBA::Object_var &effective_target,
196 Collocation_Strategy strat);
198 } // End namespace TAO
200 TAO_END_VERSIONED_NAMESPACE_DECL
202 #include /**/ "ace/post.h"
203 #endif /*TAO_INVOCATION_ADAPTER_H*/