Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Argument.h
blob39740bb52301ff1626a6427da4138b0bfe13e542
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Argument.h
7 * @author Jeff Parsons
8 * @author Carlos O'Ryan
9 */
10 //=============================================================================
12 #ifndef TAO_ARGUMENT_H
13 #define TAO_ARGUMENT_H
15 #include /**/ "ace/pre.h"
17 #include "tao/Basic_Types.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 # pragma once
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #include "tao/orbconf.h"
24 #include /**/ "tao/TAO_Export.h"
25 #include "tao/ParameterModeC.h"
27 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
29 namespace CORBA
31 class Any;
34 class TAO_OutputCDR;
35 class TAO_InputCDR;
37 namespace TAO
39 /**
40 * @class Argument
42 * @brief Base class for argument class templates.
44 * @c Argument subclasses override the virtual methods
45 * appropriately. For example, a stub "IN" argument class
46 * template would override the @c marshal() method, but wouldn't
47 * need to override the @c demarshal() method.
49 class TAO_Export Argument
51 public:
52 /// Destructor.
53 virtual ~Argument ();
55 /// Marshal the argument into the given CDR output stream.
56 /**
57 * @note The default implementation simply returns @c true.
59 virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr);
61 /// Demarshal the argument from the given CDR input stream.
62 /**
63 * @note The default implementation simply returns @c true.
65 virtual CORBA::Boolean demarshal (TAO_InputCDR &);
67 /// Template method to clone a TAO Argument
68 virtual Argument* clone ();
70 #if TAO_HAS_INTERCEPTORS == 1
72 /**
73 * @name Portable Interceptor Related Methods
75 * These methods are only used when setting up
76 * @c PortableInterceptor::RequestInfo instances with the
77 * appropriate operation-specific parameter list and return
78 * value, if either or both exist.
80 //@{
81 /// Populate the given @a CORBA::Any result argument.
82 /**
83 * @note The default implementation is a no-op.
85 virtual void interceptor_value (CORBA::Any *) const;
87 /// Get the parameter mode of this argument
88 virtual CORBA::ParameterMode mode () const = 0;
89 //@}
91 #endif /* TAO_HAS_INTERCEPTORS == 1 */
94 #if TAO_HAS_INTERCEPTORS == 1
95 class TAO_Export InArgument : public Argument
97 public:
98 virtual CORBA::ParameterMode mode () const;
100 #else
101 typedef Argument InArgument;
102 #endif
104 #if TAO_HAS_INTERCEPTORS == 1
105 class TAO_Export InoutArgument : public Argument
107 public:
108 virtual CORBA::ParameterMode mode () const;
110 #else
111 typedef Argument InoutArgument;
112 #endif
114 #if TAO_HAS_INTERCEPTORS == 1
115 class TAO_Export OutArgument : public Argument
117 public:
118 virtual CORBA::ParameterMode mode () const;
120 #else
121 typedef Argument OutArgument;
122 #endif
124 #if TAO_HAS_INTERCEPTORS == 1
125 class TAO_Export RetArgument : public Argument
127 public:
128 virtual CORBA::ParameterMode mode () const;
130 #else
131 typedef Argument RetArgument;
132 #endif
134 class TAO_Export Void_Return_Argument : public RetArgument
136 public:
137 virtual Argument* clone ();
141 TAO_END_VERSIONED_NAMESPACE_DECL
143 #include /**/ "ace/post.h"
145 #endif /* TAO_ARGUMENT_H */