summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be_include/be_visitor_dds_ts_idl.h
blob: 03184b0fb39fcfdd9efca7b0e62d317ce51c1a8b (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
/* -*- c++ -*- */

//=============================================================================
/**
 *  @file    be_visitor_dds_ts_idl.h
 *
 *  Concrete visitor.
 *  This one provides code generation for
 *  DDS type support IDL files.
 *
 *  @author Jeff Parsons
 */
//=============================================================================

#ifndef _BE_VISITOR_DDS_TS_IDL_H_
#define _BE_VISITOR_DDS_TS_IDL_H_

#include "be_visitor_scope.h"

/**
 * @class be_visitor_dds_ts_idl
 *
 * @brief be_visitor_dds_ts_idl
 *
 * This is a concrete visitor to generate the DDS type support IDL
 */
class be_visitor_dds_ts_idl : public be_visitor_scope
{
public:
  be_visitor_dds_ts_idl (be_visitor_context *ctx);

  ~be_visitor_dds_ts_idl ();

  virtual int visit_root (be_root *node);
  virtual int visit_module (be_module *node);

  /// The only types recognized so far as DDS datatypes.
  virtual int visit_structure (be_structure *node);
  virtual int visit_union (be_union *node);
  virtual int visit_valuetype (be_valuetype *node);

/// Common code for processing all datatypes.
private:
  int process_node (be_type *node);
  void gen_datawriter (be_type *node);
  void gen_datareader (be_type *node);

  /// Manage streams and files.
  int init_file ();
  void fini_file ();

private:
  TAO_OutStream *os_ptr_;
};

#endif /* _BE_VISITOR_DDS_TS_IDL_H_ */