3 //=============================================================================
7 * Thru-POA/skeleton argument selection function templates.
9 * These function templates are used to choose between arguments
10 * supplied in thru-POA collocated invocations and arguments in
11 * uncollocated invocations.
13 * @note A function template approach is used to avoid complicated
14 * argument conversions between stub supplied arguments and
15 * skeleton supplied ones. For example, it is possible to make
16 * argument selection more transparent by taking advantage of
17 * run-time polymorphism. However, that approach would incur
18 * additional footprint overhead on the client side due to the
19 * introduction of virtual tables, etc.
21 * @author Ossama Othman
23 //=============================================================================
28 #include /**/ "ace/pre.h"
30 #include "tao/PortableServer/SArg_Traits_T.h"
31 #include "tao/operation_details.h"
33 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
37 namespace Portable_Server
39 /// Get return value/argument.
41 typename
TAO::SArg_Traits
<T
>::ret_arg_type
42 get_ret_arg (TAO_Operation_Details
const * details
,
43 TAO::Argument
* const * skel_args
)
46 (details
!= 0 && details
->use_stub_args ())
47 ? static_cast<typename
TAO::Arg_Traits
<T
>::ret_val
*> (
48 details
->args ()[0])->arg ()
49 : static_cast<typename
TAO::SArg_Traits
<T
>::ret_val
*> (
50 skel_args
[0])->arg ();
53 /// Get "in" argument.
55 typename
TAO::SArg_Traits
<T
>::in_arg_type
56 get_in_arg (TAO_Operation_Details
const * details
,
57 TAO::Argument
* const * skel_args
,
61 (details
!= 0 && details
->use_stub_args ())
62 ? static_cast<typename
TAO::Arg_Traits
<T
>::in_arg_val
*> (
63 details
->args ()[i
])->arg ()
64 : static_cast<typename
TAO::SArg_Traits
<T
>::in_arg_val
*> (
65 skel_args
[i
])->arg ();
68 /// Get "inout" argument.
70 typename
TAO::SArg_Traits
<T
>::inout_arg_type
71 get_inout_arg (TAO_Operation_Details
const * details
,
72 TAO::Argument
* const * skel_args
,
76 (details
!= 0 && details
->use_stub_args ())
77 ? static_cast<typename
TAO::Arg_Traits
<T
>::inout_arg_val
*> (
78 details
->args ()[i
])->arg ()
79 : static_cast<typename
TAO::SArg_Traits
<T
>::inout_arg_val
*> (
80 skel_args
[i
])->arg ();
83 /// Get "out" argument.
85 typename
TAO::SArg_Traits
<T
>::out_arg_type
86 get_out_arg (TAO_Operation_Details
const * details
,
87 TAO::Argument
* const * skel_args
,
91 (details
!= 0 && details
->use_stub_args ())
92 ? static_cast<typename
TAO::Arg_Traits
<T
>::out_arg_val
*> (
93 details
->args ()[i
])->arg ()
94 : static_cast<typename
TAO::SArg_Traits
<T
>::out_arg_val
*> (
95 skel_args
[i
])->arg ();
100 TAO_END_VERSIONED_NAMESPACE_DECL
102 #include /**/ "ace/post.h"
104 #endif /* TAO_GET_ARG_H*/