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

// ===================================================================
/**
 *  @file   GIOP_Message_Generator_Parser.h
 *
 *  @author Balachandran Natarajan <bala@cs.wustl.edu>
 */
// ===================================================================

#ifndef TAO_GIOP_MESSAGE_GENERATOR_PARSER_H
#define TAO_GIOP_MESSAGE_GENERATOR_PARSER_H

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

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

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

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

class TAO_Operation_Details;
class TAO_Target_Specification;
class TAO_OutputCDR;
class TAO_InputCDR;
class TAO_Pluggable_Reply_Params;
class TAO_Pluggable_Reply_Params_Base;
class TAO_GIOP_Locate_Status_Msg;
class TAO_GIOP_Locate_Request_Header;
class TAO_ServerRequest;

/**
 * @class TAO_GIOP_Message_Generator_Parser
 *
 * @brief Base class for the GIOP Message generator and parser
 *
 * Version specific classes would inherit from this class. Strategy to
 * determine which version of the GIOP request have we received and
 * which version do we need to use to send messages.
 */

class TAO_GIOP_Message_Generator_Parser
{
public:
  virtual ~TAO_GIOP_Message_Generator_Parser ();

  /// Write the request header in to @a msg
  virtual bool write_request_header (
      const TAO_Operation_Details &opdetails,
      TAO_Target_Specification &spec,
      TAO_OutputCDR &msg) = 0;

  /// Write the LocateRequest header
  virtual bool write_locate_request_header (
      CORBA::ULong request_id,
      TAO_Target_Specification &spec,
      TAO_OutputCDR &msg) = 0;

  /// Write the reply header in to @a output
  virtual bool write_reply_header (
      TAO_OutputCDR &output,
      TAO_Pluggable_Reply_Params_Base &reply) = 0;

  /// Writes the locate _reply message in to the @a output
  virtual bool write_locate_reply_mesg (
      TAO_OutputCDR &output,
      CORBA::ULong request_id,
      TAO_GIOP_Locate_Status_Msg &status) = 0;

  /// Write the GIOP fragment message header to the output CDR stream
  /// @a cdr.
  virtual bool write_fragment_header (TAO_OutputCDR & cdr,
                                      CORBA::ULong request_id) = 0;

  /// Parse the Request Header from the incoming stream. This will do a
  /// version specific parsing of the incoming Request header
  virtual int parse_request_header (TAO_ServerRequest &) = 0;

  /// Parse the Locate Request Header from the incoming stream. This will do a
  /// version specific parsing of the incoming Request header
  virtual int parse_locate_header (TAO_GIOP_Locate_Request_Header &) = 0;

  /// Parse the reply message
  virtual int parse_reply (TAO_InputCDR &input,
                           TAO_Pluggable_Reply_Params &params);

  /// Parse the locate reply message from the server
  virtual int parse_locate_reply (TAO_InputCDR &input,
                                  TAO_Pluggable_Reply_Params &params);

  /// Our versions
  virtual CORBA::Octet major_version () const = 0;
  virtual CORBA::Octet minor_version () const = 0;

  /// Is the messaging object ready for processing BiDirectional
  /// request/response?
  virtual bool is_ready_for_bidirectional () const;

  /// The header length of a fragment
  virtual size_t fragment_header_length () const = 0;
};

TAO_END_VERSIONED_NAMESPACE_DECL

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

#endif /*TAO_GIOP_MESSAGE_GENERATOR_PARSER_H*/