summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be_include/be_decl.h
blob: b351042b521df4a431afa1825b110e4a44157096 (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
/* -*- c++ -*- */
// ============================================================================
//
// = LIBRARY
//    TAO IDL
//
// = FILENAME
//    be_decl.h
//
// = DESCRIPTION
//    Extension of the AST_Decl class.
//
// = AUTHOR
//    Copyright 1994-1995 by Sun Microsystems, Inc.
//    and
//    Aniruddha Gokhale
//
// ============================================================================

#if !defined (TAO_BE_DECL_H)
#define TAO_BE_DECL_H

/*
 * BE_Decl
 */
class be_decl : public virtual AST_Decl
{
  // = TITLE
  //   be_decl
  // = DESCRIPTION
  //   The back end extension of the AST_Decl class. Provides an abstract
  //   interface
  //
public:
  enum SIZE_TYPE
  {
    FIXED,
    VARIABLE
  };
  // indicates if we are fixed size or variable. Most useful for structs,
  // unions, and arrays.

  // =Operations

  be_decl (void);
  // Default constructor

  be_decl (AST_Decl::NodeType type, UTL_ScopedName *n, UTL_StrList *pragmas);
  // constructor that sets the node type

  ~be_decl (void);
  // destructor

  virtual int gen_client_header (void) = 0;
  // Generates the client-side header information for the decl

  virtual int gen_client_stubs (void) = 0;
  // Generates the client-side stubs for the decl

  virtual int gen_server_header (void) = 0;
  // Generates the server-side header information for the decl

  virtual int gen_server_skeletons (void) = 0;
  // Generates the server-side skeletons for the decl

  virtual int gen_client_inline (void) = 0;
  // Generates the client-side inline for the decl

  virtual int gen_server_inline (void) = 0;
  // Generates the server-side inlines for the decl

  virtual void size_type (SIZE_TYPE);
  // set the size type

  virtual SIZE_TYPE size_type (void) const;
  // return our size type

  const char *repoID (void);
  // retrieve the repository ID

  const char *fullname (void);
  // return the stringified full name

  const char *flatname (void);
  // return the flattened full scoped name

  virtual idl_bool is_nested (void);
  // determines if we are inside of a nested scope or not

  virtual int gen_encapsulation (void);
  // encapsulation of parameters

  virtual long tc_encap_len (void);
  // return length of encapsulation

  // Narrowing
  DEF_NARROW_METHODS1 (be_decl, AST_Decl);
  DEF_NARROW_FROM_DECL (be_decl);

protected:
  // =helper

  virtual void compute_repoID (void);
  // computes the repoID

  virtual void compute_fullname (void);
  // computes the fully scoped name

  virtual void compute_flatname (void);
  // compute the flattened fully scoped name

  virtual int tc_name2long (const char *name, long *&, long &);
  // name represented as a padded array of longs

  virtual long repoID_encap_len (void);
  // return encapsulation length required to hold repository ID

  virtual long name_encap_len (void);
  // return encapsulation length required to hold IDL name

  // variables that indicate if the code generation for that node is already
  // been done. This way we avoid regenerating same code.
  idl_bool cli_hdr_gen_;
  idl_bool cli_stub_gen_;
  idl_bool cli_inline_gen_;
  idl_bool srv_hdr_gen_;
  idl_bool srv_skel_gen_;
  idl_bool srv_inline_gen_;

  char *fullname_;
  // our full scoped name

  char *flatname_;
  // flattened fully scoped name

  char *repoID_;
  // repository ID

  SIZE_TYPE size_type_;
  // whether we are fixed or variable size (by default fixed)

  long encap_len_;
  // encapsulation length - required for typecodes

};

#endif // if !defined