summaryrefslogtreecommitdiff
path: root/TAO/tao/Argument.h
blob: cbaee13f83dd15e126d92ac4a3bd8f341514c5a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
// -*- C++ -*-

//=============================================================================
/**
 *  @file    Argument.h
 *
 *  $Id$
 *
 *  @author Jeff Parsons
 *  @author Carlos O'Ryan
 */
//=============================================================================


#ifndef TAO_ARGUMENT_H
#define TAO_ARGUMENT_H

#include /**/ "ace/pre.h"

#include "tao/Basic_Types.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "tao/orbconf.h"
#include "tao/TAO_Export.h"
#include "tao/ParameterModeC.h"

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

namespace CORBA
{
  class Any;
}

class TAO_OutputCDR;
class TAO_InputCDR;

namespace TAO
{
  /**
   * @class Argument
   *
   * @brief Base class for argument class templates.
   *
   * @c Argument subclasses override the virtual methods
   *    appropriately.  For example, a stub "IN" argument class
   *    template would override the @c marshal() method, but wouldn't
   *    need to override the @c demarshal() method.
   */
  class TAO_Export Argument
  {
  public:

    /// Destructor.
    virtual ~Argument (void);

    /// Marshal the argument into the given CDR output stream.
    /**
     * @note The default implementation simply returns @c true.
     */
    virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr);

    /// Demarshal the argument from the given CDR input stream.
    /**
     * @note The default implementation simply returns @c true.
     */
    virtual CORBA::Boolean demarshal (TAO_InputCDR &);

#if TAO_HAS_INTERCEPTORS == 1

    /**
     * @name Portable Interceptor Related Methods
     *
     * These methods are only used when setting up
     * @c PortableInterceptor::RequestInfo instances with the
     * appropriate operation-specific parameter list and return
     * value, if either or both exist.
     */
    //@{
    /// Populate the given @a CORBA::Any result argument.
    /**
     * @note The default implementation is a no-op.
     */
    virtual void interceptor_value (CORBA::Any *) const;

    /// Get the parameter mode of this argument
    virtual CORBA::ParameterMode mode (void) const = 0;
    //@}

#endif /* TAO_HAS_INTERCEPTORS == 1 */

  };

  class TAO_Export InArgument : public Argument
  {
  public:
#if TAO_HAS_INTERCEPTORS == 1
    virtual CORBA::ParameterMode mode (void) const;
#endif
  };

  class TAO_Export InoutArgument : public Argument
  {
  public:
#if TAO_HAS_INTERCEPTORS == 1
    virtual CORBA::ParameterMode mode (void) const;
#endif
  };

  class TAO_Export OutArgument : public Argument
  {
  public:
#if TAO_HAS_INTERCEPTORS == 1
    virtual CORBA::ParameterMode mode (void) const;
#endif
  };

  class TAO_Export RetArgument : public Argument
  {
  public:
#if TAO_HAS_INTERCEPTORS == 1
    virtual CORBA::ParameterMode mode (void) const;
#endif
  };
}

TAO_END_VERSIONED_NAMESPACE_DECL

#include /**/ "ace/post.h"

#endif /* TAO_ARGUMENT_H */