summaryrefslogtreecommitdiff
path: root/TAO/tao/PortableServer/Upcall_Wrapper.h
blob: d2585c5ba66f2b2daefec8db0e1d12763b11ae82 (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
// -*- C++ -*-

//=============================================================================
/**
 *  @file    Upcall_Wrapper.h
 *
 *  @author Ossama Othman
 *  @author Jeff Parsons
 *  @author Carlos O'Ryan
 */
//=============================================================================

#ifndef TAO_UPCALL_WRAPPER_H
#define TAO_UPCALL_WRAPPER_H

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

#include "tao/PortableServer/portableserver_export.h"

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

#include "tao/Basic_Types.h"
#include "tao/orbconf.h"

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

class TAO_ServantBase;
class TAO_ServerRequest;
class TAO_InputCDR;
class TAO_OutputCDR;

namespace PortableServer
{
  typedef ::TAO_ServantBase ServantBase;
}

namespace TAO
{
  class Argument;
  class Upcall_Command;

  namespace Portable_Server
  {
    class Servant_Upcall;
  }

  /**
   * @class Upcall_Wrapper
   *
   * @brief Wraps the activities of the _skel operations.
   *
   */
  class TAO_PortableServer_Export Upcall_Wrapper
  {
  public:
    /**
     * @note The TAO::Argument corresponding to the return value is
     *       always the first element in the array, regardless of
     *       whether or not the return type is void.
     */

    /// Perform the upcall.
    /**
     * @param server_request Object containing server side messaging
     *                       operations (e.g. CDR reply construction, etc).
     * @param args           Operation argument list.
     * @param nargs          Number of arguments in the operation
     *                       argument list.
     * @param command        @c Command object that performs the
     *                       actual upcall into the servant.
     * @param servant_upcall Object containing information for POA
     *                       that dispatched the servant.
     * @param exceptions     Array of user exceptions the operation
     *                       may raise.
     * @param nexceptions    The number of exceptions in the operation
     *                       user exception array.
     */
    void upcall (TAO_ServerRequest & server_request,
                 TAO::Argument * const args[],
                 size_t nargs,
                 TAO::Upcall_Command & command
#if TAO_HAS_INTERCEPTORS == 1
                 , TAO::Portable_Server::Servant_Upcall *servant_upcall
                 , CORBA::TypeCode_ptr const * exceptions
                 , CORBA::ULong nexceptions
#endif  /* TAO_HAS_INTERCEPTORS == 1 */
                );

  private:
    /// Perform pre-upcall operations.
    /**
     * Perform pre-upcall operations, including operation @c IN and
     * @c INOUT argument demarshaling.
     */
    void pre_upcall (TAO_InputCDR & cdr,
                     TAO::Argument * const * args,
                     size_t nargs);

    /// Perform post-upcall operations.
    /**
     * Perform post-upcall operations, including operation @c INOUT
     * and @c OUT argument marshaling.
     */
    void post_upcall (TAO_ServerRequest& server_request,
                      TAO::Argument * const * args,
                      size_t nargs);
  };
}  // End namespace TAO

TAO_END_VERSIONED_NAMESPACE_DECL

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

#endif /* TAO_UPCALL_WRAPPER_H */