Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / TAO_IDL / be_include / be_visitor_interface / interface.h
blob86e324fd12122a35e9a9a40f2bf65b250137503c
1 /* -*- c++ -*- */
2 //=============================================================================
3 /**
4 * @file interface.h
6 * Concrete visitor for the Interface node.
7 * This one provides the generic visitor for interfaces from which others
8 * will inherit.
10 * @author Aniruddha Gokhale
12 //=============================================================================
14 #ifndef _BE_INTERFACE_INTERFACE_H_
15 #define _BE_INTERFACE_INTERFACE_H_
17 // = DESCRIPTION
18 // Interface code generation is complex, the client stubs require
19 // two different class and the server also require other two.
20 // Only one of them includes whatever nested typedefs, exceptions
21 // and or structures are defined in the interface.
22 // To break this complexity a different visitor is used for each
23 // case.
25 // = NOTE
26 // Visitors were added recently into the compiler, so some
27 // code is still generated using the old "state oriented" approach;
28 // notably only the _collocated class is actually generated using
29 // the visitor, in the other cases (the interface class and the
30 // skeleton class) we still call back the old code generation
31 // methods.
34 class AST_Operation;
36 /**
37 * @class be_visitor_interface
39 * @brief be_visitor_interface
41 * This is a concrete visitor for interface that abstracts
42 * all common tasks.
44 class be_visitor_interface : public be_visitor_scope
46 public:
47 be_visitor_interface (be_visitor_context *ctx);
48 ~be_visitor_interface (void);
50 virtual int visit_interface (be_interface *node);
52 /// An override of the base class method so we can generate code for
53 /// any abstract parents the interface may have.
54 virtual int visit_scope (be_scope *node);
56 virtual int visit_attribute (be_attribute *node);
57 virtual int visit_constant (be_constant *node);
58 virtual int visit_native (be_native *node);
59 virtual int visit_enum (be_enum *node);
60 virtual int visit_exception (be_exception *node);
61 virtual int visit_operation (be_operation *node);
62 virtual int visit_structure (be_structure *node);
63 virtual int visit_structure_fwd (be_structure_fwd *node);
64 virtual int visit_union (be_union *node);
65 virtual int visit_union_fwd (be_union_fwd *node);
66 virtual int visit_typedef (be_typedef *node);
68 protected:
69 int is_amh_rh_node (be_interface *node);
71 static void add_abstract_op_args (AST_Operation *old_op,
72 be_operation &new_op);
75 #endif /* _BE_INTERFACE_INTERFACE_H_ */