summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be_include/be_visitor_args.h
blob: 6f2b7e8a4b3cbe4c384ba06ce3a7cbab0a5e8dcd (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
//
// $Id$
//

#ifndef _BE_VISITOR_ARGS_H
#define _BE_VISITOR_ARGS_H

#include "be_visitor.h"

class TAO_OutStream;

class be_visitor_args_decl : public be_visitor
{
  //
  // = TITLE
  //   Generates the code for arguments output.
  //
  // = DESCRIPTION
  //   At several stages in the code generation a node of type
  //   "be_operation" is visited, and the code for its arguments must
  //   be generated.
  //   Sometimes the argument declarations must be generated (such as
  //   in the class declaration), other the arguments names (such as
  //   in method invocations).
  //   This class implements the declaration output, in other words,
  //   it outputs both the arguments and their types.
  //
public:
  be_visitor_args_decl (TAO_OutStream *stream);
  virtual ~be_visitor_args_decl (void);

  virtual int visit_operation (be_operation *node);
  virtual int visit_argument (be_argument *node);
  virtual int visit_predefined_type (be_predefined_type *node);
  virtual int visit_interface (be_interface *node);
  virtual int visit_interface_fwd (be_interface_fwd *node);
  virtual int visit_structure (be_structure *node);
  virtual int visit_enum (be_enum *node);
  virtual int visit_union (be_union *node);
  virtual int visit_array (be_array *node);
  virtual int visit_sequence (be_sequence *node);
  virtual int visit_string (be_string *node);
  virtual int visit_typedef (be_typedef *node);
  virtual int visit_native (be_native *node);

  void argument_direction (int direction);
  void current_type_name (UTL_ScopedName* name);

private:
  TAO_OutStream& stream (void) const;

  // Several types have the same or very similar mappings, for
  // instance: structures, unions and sequences, this routines
  // abstract those mappings.
  int dump_interface (void) const;
  int dump_structure (void) const;

private:
  TAO_OutStream *stream_;

  int argument_direction_;
  // The current argument direction.

  UTL_ScopedName* current_type_name_;
  // The scoped name for the current argument type name.
  // We cannot use just node->name() because we could be using an
  // aliased name (through typedefs) in which case the real name must
  // be used.
};

#endif // _BE_VISITOR_ARGS_H