summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be_include/be_visitor_typedef.h
blob: 270f2aae6a075b163ba1d37194cadf8200e31b81 (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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
/* -*- c++ -*- */
//
// $Id$
//

// ============================================================================
//
// = LIBRARY
//    TAO IDL
//
// = FILENAME
//    be_visitor_typedef.h
//
// = DESCRIPTION
//    Concrete visitor for the Typedef class
//
// = AUTHOR
//    Aniruddha Gokhale
//
// ============================================================================

#if !defined (TAO_BE_VISITOR_TYPEDEF_H)
#define TAO_BE_VISITOR_TYPEDEF_H

#include "be_visitor.h"
#include "be_visitor_scope.h"

class be_visitor_typedef : public be_visitor_decl
{
  //
  // = TITLE
  //    be_visitor_typedef
  //
  // = DESCRIPTION
  //    This is a concrete visitor for typedef that abstracts all common tasks
  //

public:
  be_visitor_typedef (be_visitor_context *ctx);
  // constructor

  ~be_visitor_typedef (void);
  // destructor

  virtual int visit_typedef (be_typedef *node);
  // must be overridden

  // =visit methods on all elements syntactically valid as types that can be
  // typedefed.

  virtual int visit_array (be_array *node);
  // visit a array

  virtual int visit_enum (be_enum *node);
  // visit an enum

  virtual int visit_predefined_type (be_predefined_type *node);
  // visit predefined type node

  virtual int visit_string (be_string *node);
  // visit a typedef

  virtual int visit_sequence (be_sequence *node);
  // visit a sequence

  virtual int visit_structure (be_structure *node);
  // visit a structure

  virtual int visit_union (be_union *node);
  // visit a union

};

// we need derived typedef visitors for the client files.

class be_visitor_typedef_ch : public be_visitor_typedef
{
  //
  // = TITLE
  //   be_visitor_typedef_ch
  //
  // = DESCRIPTION
  //   This is a concrete visitor to generate the client header for typedef
  //
  //
public:
  be_visitor_typedef_ch (be_visitor_context *ctx);
  // constructor

  ~be_visitor_typedef_ch (void);
  // destructor

  virtual int visit_typedef (be_typedef *node);
  // visit typedef. We provide code for this method in the derived class

  // =visit methods on all elements syntactically valid as types that can be
  // typedefed.

  virtual int visit_array (be_array *node);
  // visit a array

  virtual int visit_enum (be_enum *node);
  // visit an enum

  virtual int visit_predefined_type (be_predefined_type *node);
  // visit predefined type node

  virtual int visit_string (be_string *node);
  // visit a typedef

  virtual int visit_sequence (be_sequence *node);
  // visit a sequence

  virtual int visit_structure (be_structure *node);
  // visit a structure

  virtual int visit_union (be_union *node);
  // visit a union

};

class be_visitor_typedef_ci : public be_visitor_typedef
{
  //
  // = TITLE
  //   be_visitor_typedef_sh
  //
  // = DESCRIPTION
  //   This is a concrete visitor to generate the server header for typedef
  //
  //
public:
  be_visitor_typedef_ci (be_visitor_context *ctx);
  // constructor

  ~be_visitor_typedef_ci (void);
  // destructor

  virtual int visit_typedef (be_typedef *node);
  // visit typedef. We provide code for this method in the derived class

  // =visit methods on all elements syntactically valid as types that can be
  // typedefed.

  virtual int visit_array (be_array *node);
  // visit a array

  virtual int visit_sequence (be_sequence *node);
  // visit a sequence

  virtual int visit_structure (be_structure *node);
  // visit a structure

  virtual int visit_union (be_union *node);
  // visit a union

};

class be_visitor_typedef_cs : public be_visitor_typedef
{
  //
  // = TITLE
  //   be_visitor_typedef_cs
  //
  // = DESCRIPTION
  //   This is a concrete visitor to generate the server header for typedef
  //
  //
public:
  be_visitor_typedef_cs (be_visitor_context *ctx);
  // constructor

  ~be_visitor_typedef_cs (void);
  // destructor

  virtual int visit_typedef (be_typedef *node);
  // visit typedef. We provide code for this method in the derived class

};


#endif // TAO_BE_VISITOR_TYPEDEF_H