diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-07-01 13:49:23 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-07-01 13:49:23 +0000 |
commit | 0155b2254e16d6c9e5d0b6c0c101de84e4fe432f (patch) | |
tree | 3b973276984c17f2240b1724fe1c92026081e981 /TAO/TAO_IDL/be/be_visitor_context.cpp | |
parent | 23696f26059dd5f33b655db7be60db00400ba408 (diff) | |
download | ATCD-0155b2254e16d6c9e5d0b6c0c101de84e4fe432f.tar.gz |
ChangeLogTag: Mon Jul 1 08:31:04 2002 Jeff Parsons <parsons@cs.wustl.edu>
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_context.cpp')
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_context.cpp | 339 |
1 files changed, 222 insertions, 117 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_context.cpp b/TAO/TAO_IDL/be/be_visitor_context.cpp index 8102f332f78..42b0791edc4 100644 --- a/TAO/TAO_IDL/be/be_visitor_context.cpp +++ b/TAO/TAO_IDL/be/be_visitor_context.cpp @@ -18,11 +18,32 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -ACE_RCSID(be, be_visitor_context, "$Id$") +#include "be_argument.h" +#include "be_array.h" +#include "be_attribute.h" +#include "be_constant.h" +#include "be_enum.h" +#include "be_enum_val.h" +#include "be_exception.h" +#include "be_field.h" +#include "be_interface.h" +#include "be_interface_fwd.h" +#include "be_module.h" +#include "be_operation.h" +#include "be_predefined_type.h" +#include "be_root.h" +#include "be_sequence.h" +#include "be_string.h" +#include "be_structure.h" +#include "be_typedef.h" +#include "be_union.h" +#include "be_union_branch.h" + +#include "be_visitor_context.h" + +ACE_RCSID (be, + be_visitor_context, + "$Id$") // constructor @@ -231,284 +252,368 @@ be_visitor_context::interface (void) const // **************************************************************** -// return the node as argument if possible be_argument * be_visitor_context::be_node_as_argument (void) { - if (this->node_) - return be_argument::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_argument::narrow_from_decl (this->node_); + } else - return (be_argument *)0; + { + return 0; + } } -// return the node as array if possible be_array * be_visitor_context::be_node_as_array (void) { - if (this->node_) - return be_array::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_array::narrow_from_decl (this->node_); + } else - return (be_array *)0; + { + return 0; + } } -// return the node as attribute if possible be_attribute * be_visitor_context::be_node_as_attribute (void) { - if (this->node_) - return be_attribute::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_attribute::narrow_from_decl (this->node_); + } else - return (be_attribute *)0; + { + return 0; + } } -// return the node as constant if possible be_constant * be_visitor_context::be_node_as_constant (void) { - if (this->node_) - return be_constant::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_constant::narrow_from_decl (this->node_); + } else - return (be_constant *)0; + { + return 0; + } } -// return the node as enum if possible be_enum * be_visitor_context::be_node_as_enum (void) { - if (this->node_) - return be_enum::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_enum::narrow_from_decl (this->node_); + } else - return (be_enum *)0; + { + return 0; + } } -// return the node as enum_val if possible be_enum_val * be_visitor_context::be_node_as_enum_val (void) { - if (this->node_) - return be_enum_val::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_enum_val::narrow_from_decl (this->node_); + } else + { + return 0; + } return (be_enum_val *)0; } -// return the node as exception if possible be_exception * be_visitor_context::be_node_as_exception (void) { - if (this->node_) - return be_exception::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_exception::narrow_from_decl (this->node_); + } else - return (be_exception *)0; + { + return 0; + } } -// return the node as field if possible be_field * be_visitor_context::be_node_as_field (void) { - if (this->node_) - return be_field::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_field::narrow_from_decl (this->node_); + } else - return (be_field *)0; + { + return 0; + } } -// return the node as interface if possible be_interface * be_visitor_context::be_node_as_interface (void) { - if (this->node_) - return be_interface::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_interface::narrow_from_decl (this->node_); + } else - return (be_interface *)0; + { + return 0; + } } -// return the node as interface_fwd if possible be_interface_fwd * be_visitor_context::be_node_as_interface_fwd (void) { - if (this->node_) - return be_interface_fwd::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_interface_fwd::narrow_from_decl (this->node_); + } else - return (be_interface_fwd *)0; + { + return 0; + } } -// return the node as module if possible be_module * be_visitor_context::be_node_as_module (void) { - if (this->node_) - return be_module::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_module::narrow_from_decl (this->node_); + } else - return (be_module *)0; + { + return 0; + } } -// return the node as operation if possible be_operation * be_visitor_context::be_node_as_operation (void) { - if (this->node_) - return be_operation::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_operation::narrow_from_decl (this->node_); + } else - return (be_operation *)0; + { + return 0; + } } -// return the node as predefined_type if possible be_predefined_type * be_visitor_context::be_node_as_predefined_type (void) { - if (this->node_) - return be_predefined_type::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_predefined_type::narrow_from_decl (this->node_); + } else - return (be_predefined_type *)0; + { + return 0; + } } -// return the node as root if possible be_root * be_visitor_context::be_node_as_root (void) { - if (this->node_) - return be_root::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_root::narrow_from_decl (this->node_); + } else - return (be_root *)0; + { + return 0; + } } -// return the node as sequence if possible be_sequence * be_visitor_context::be_node_as_sequence (void) { - if (this->node_) - return be_sequence::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_sequence::narrow_from_decl (this->node_); + } else - return (be_sequence *)0; + { + return 0; + } } -// return the node as string if possible be_string * be_visitor_context::be_node_as_string (void) { - if (this->node_) - return be_string::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_string::narrow_from_decl (this->node_); + } else - return (be_string *)0; + { + return 0; + } } -// return the node as structure if possible be_structure * be_visitor_context::be_node_as_structure (void) { - if (this->node_) - return be_structure::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_structure::narrow_from_decl (this->node_); + } else - return (be_structure *)0; + { + return 0; + } } -// return the node as typedef if possible be_typedef * be_visitor_context::be_node_as_typedef (void) { - if (this->node_) - return be_typedef::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_typedef::narrow_from_decl (this->node_); + } else - return (be_typedef *)0; + { + return 0; + } } -// return the node as union if possible be_union * be_visitor_context::be_node_as_union (void) { - if (this->node_) - return be_union::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_union::narrow_from_decl (this->node_); + } else - return (be_union *)0; + { + return 0; + } } -// return the node as union_branch if possible be_union_branch * be_visitor_context::be_node_as_union_branch (void) { - if (this->node_) - return be_union_branch::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_union_branch::narrow_from_decl (this->node_); + } else - return (be_union_branch *)0; + { + return 0; + } } -// for scope - -// return the scope as enum if possible be_enum * be_visitor_context::be_scope_as_enum (void) { - if (this->scope_) - return be_enum::narrow_from_decl (this->scope_); + if (this->scope_ != 0) + { + return be_enum::narrow_from_decl (this->scope_); + } else - return (be_enum *)0; + { + return 0; + } } -// return the scope as exception if possible be_exception * be_visitor_context::be_scope_as_exception (void) { - if (this->scope_) - return be_exception::narrow_from_decl (this->scope_); + if (this->scope_ != 0) + { + return be_exception::narrow_from_decl (this->scope_); + } else - return (be_exception *)0; + { + return 0; + } } -// return the scope as interface if possible be_interface * be_visitor_context::be_scope_as_interface (void) { - if (this->scope_) - return be_interface::narrow_from_decl (this->scope_); + if (this->scope_ != 0) + { + return be_interface::narrow_from_decl (this->scope_); + } else + { + return 0; + } return (be_interface *)0; } -// return the scope as module if possible be_module * be_visitor_context::be_scope_as_module (void) { - if (this->scope_) - return be_module::narrow_from_decl (this->scope_); + if (this->scope_ != 0) + { + return be_module::narrow_from_decl (this->scope_); + } else - return (be_module *)0; + { + return 0; + } } -// return the scope as operation if possible be_operation * be_visitor_context::be_scope_as_operation (void) { - if (this->scope_) - return be_operation::narrow_from_decl (this->scope_); + if (this->scope_ != 0) + { + return be_operation::narrow_from_decl (this->scope_); + } else - return (be_operation *)0; + { + return 0; + } } -// return the scope as root if possible be_root * be_visitor_context::be_scope_as_root (void) { - if (this->scope_) - return be_root::narrow_from_decl (this->scope_); + if (this->scope_ != 0) + { + return be_root::narrow_from_decl (this->scope_); + } else - return (be_root *)0; + { + return 0; + } } -// return the scope as structure if possible be_structure * be_visitor_context::be_scope_as_structure (void) { - if (this->scope_) - return be_structure::narrow_from_decl (this->scope_); + if (this->scope_ != 0) + { + return be_structure::narrow_from_decl (this->scope_); + } else - return (be_structure *)0; + { + return 0; + } } -// return the scope as union if possible be_union * be_visitor_context::be_scope_as_union (void) { - if (this->scope_) - return be_union::narrow_from_decl (this->scope_); + if (this->scope_ != 0) + { + return be_union::narrow_from_decl (this->scope_); + } else - return (be_union *)0; + { + return 0; + } } |