summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_structure.h
blob: bbb2dca51eb5359b684903cd9302435dfc40e8fa (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

/* -*- C++ -*- */
//=============================================================================
/**
 *  @file    ifr_adding_visitor_structure.h
 *
 *  Header file for class ifr_adding_visitor_structure.
 *
 *  @author Jeff Parsons <parsons@cs.wustl.edu>
 */
//=============================================================================


#ifndef TAO_IFR_ADDING_VISITOR_STRUCTURE_H
#define TAO_IFR_ADDING_VISITOR_STRUCTURE_H

#include "ifr_adding_visitor.h"

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

/**
 * @class ifr_adding_visitor_structure
 *
 * @brief ifr_adding_visitor_structure.
 *
 * This visitor overrides a few of the visit methods
 * for the case when a struct or exception node is seen in the AST.
 */
class ifr_adding_visitor_structure : public ifr_adding_visitor
{
public:
  ifr_adding_visitor_structure (AST_Decl *scope);

  virtual ~ifr_adding_visitor_structure (void);

  virtual int visit_scope (UTL_Scope *node);
  virtual int visit_structure (AST_Structure *node);
  virtual int visit_enum (AST_Enum *node);
  virtual int visit_union (AST_Union *node);

  /// Lets the visitor one level above acess this value.
  virtual CORBA::IDLType_ptr ir_current (void) const;

private:
  /// Common code called whether we are creating a new struct
  /// or filling out a forward declaration.
  int add_members (AST_Structure *node, CORBA::StructDef_ptr struct_def);

private:
  /// Holder for the member list passed to create_struct() or
  /// create_exception().
  CORBA::StructMemberSeq members_;
};

#endif /* TAO_IFR_ADDING_VISITOR_STRUCTURE_H */