diff options
Diffstat (limited to 'TAO/TAO_IDL/be_include/be_visitor_typecode/union_typecode.h')
-rw-r--r-- | TAO/TAO_IDL/be_include/be_visitor_typecode/union_typecode.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/TAO/TAO_IDL/be_include/be_visitor_typecode/union_typecode.h b/TAO/TAO_IDL/be_include/be_visitor_typecode/union_typecode.h new file mode 100644 index 00000000000..9498461479f --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_typecode/union_typecode.h @@ -0,0 +1,67 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file union_typecode.h + * + * $Id$ + * + * Union TypeCode generation visitor. + * + * @author Ossama Othman <ossama@dre.vanderbilt.edu> + */ +//============================================================================= + +#ifndef TAO_BE_VISITOR_UNION_TYPECODE_H +#define TAO_BE_VISITOR_UNION_TYPECODE_H + +namespace TAO +{ + + /** + * @class be_visitor_union_typecode + * + * @brief Union TypeCode generation visitor. + * + * Union TypeCode generation visitor. + */ + class be_visitor_union_typecode + : public be_visitor_typecode_defn + { + public: + + /// Constructor. + be_visitor_union_typecode (be_visitor_context * ctx); + + /// Visit a union. + /** + * @todo The legacy method name "@c visit_union()" is + * redundant since it is obvious from the argument what kind + * of TypeCode is being visited. It will be changed once + * the rest of the legacy method names and their call sites + * are updated accordingly. + */ + virtual int visit_union (be_union * node); + + private: + + /// Generate union field TypeCode declarations, if necessary. + int gen_case_typecodes (be_union * node); + + /// Generate union branch related TypeCode code. + int visit_cases (be_union * node); + + private: + + /// @c true if the union is recursive. + bool is_recursive_; + + /// @c true if this visitor is already visiting an outer scope + /// struct or exception + bool is_nested_; + + }; + +} + +#endif /* TAO_BE_VISITOR_UNION_TYPECODE_H */ |