ifr_adding_visitor.h

Go to the documentation of this file.
00001 // $Id: ifr_adding_visitor.h 78850 2007-07-12 10:50:02Z parsons $
00002 
00003 /* -*- C++ -*- */
00004 // ============================================================================
00005 //
00006 // = LIBRARY
00007 //    TAO_IFR_BE_DLL
00008 //
00009 // = FILENAME
00010 //    ifr_adding_visitor.h
00011 //
00012 // = DESCRIPTION
00013 //    Header file for class ifr_adding_visitor.
00014 //
00015 // = AUTHOR
00016 //    Jeff Parsons <parsons@cs.wustl.edu>
00017 //
00018 // ============================================================================
00019 
00020 #ifndef TAO_IFR_ADDING_VISITOR_H
00021 #define TAO_IFR_ADDING_VISITOR_H
00022 
00023 #include "ifr_visitor.h"
00024 #include "tao/IFR_Client/IFR_ComponentsC.h"
00025 
00026 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00027 # pragma once
00028 #endif /* ACE_LACKS_PRAGMA_ONCE */
00029 
00030 class UTL_ExceptList;
00031 
00032 class ifr_adding_visitor : public ifr_visitor
00033 {
00034   //
00035   // = TITLE
00036   //    ifr_adding_visitor.
00037   //
00038   // = DESCRIPTION
00039   //    This visitor adds items found in the IDL file being processed
00040   //    to the Interface Repository.
00041   //
00042 public:
00043   ifr_adding_visitor (AST_Decl *scope,
00044                       CORBA::Boolean in_reopened = 0);
00045 
00046   virtual ~ifr_adding_visitor (void);
00047 
00048   virtual int visit_scope (UTL_Scope *node);
00049   virtual int visit_predefined_type (AST_PredefinedType *node);
00050   virtual int visit_module (AST_Module *node);
00051   virtual int visit_interface (AST_Interface *node);
00052   virtual int visit_interface_fwd (AST_InterfaceFwd *node);
00053   virtual int visit_valuebox (AST_ValueBox *node);
00054   virtual int visit_valuetype (AST_ValueType *node);
00055   virtual int visit_valuetype_fwd (AST_ValueTypeFwd *node);
00056   virtual int visit_component (AST_Component *node);
00057   virtual int visit_component_fwd (AST_ComponentFwd *node);
00058   virtual int visit_eventtype (AST_EventType *node);
00059   virtual int visit_eventtype_fwd (AST_EventTypeFwd *node);
00060   virtual int visit_home (AST_Home *node);
00061   virtual int visit_factory (AST_Factory *node);
00062   virtual int visit_structure (AST_Structure *node);
00063   virtual int visit_structure_fwd (AST_StructureFwd *node);
00064   virtual int visit_exception (AST_Exception *node);
00065   virtual int visit_enum (AST_Enum *node);
00066   virtual int visit_operation (AST_Operation *node);
00067   virtual int visit_field (AST_Field *node);
00068   virtual int visit_attribute (AST_Attribute *node);
00069   virtual int visit_union (AST_Union *node);
00070   virtual int visit_union_fwd (AST_UnionFwd *node);
00071   virtual int visit_constant (AST_Constant *node);
00072   virtual int visit_array (AST_Array *node);
00073   virtual int visit_sequence (AST_Sequence *node);
00074   virtual int visit_string (AST_String *node);
00075   virtual int visit_typedef (AST_Typedef *node);
00076   virtual int visit_root (AST_Root *node);
00077   virtual int visit_native (AST_Native *node);
00078 
00079 protected:
00080   CORBA::PrimitiveKind expr_type_to_pkind (AST_Expression::ExprType et);
00081   CORBA::PrimitiveKind predefined_type_to_pkind (AST_PredefinedType *node);
00082   // Conversion functions.
00083 
00084   void load_any (AST_Expression::AST_ExprValue *ev,
00085                  CORBA::Any &any);
00086   // Determine the primitive type and insert into the Any.
00087 
00088   void element_type (AST_Type *base_type, bool owned = false);
00089   // Creates or looks up the element type of an array or sequence,
00090   // and stores the result in ir_current_.
00091 
00092   int create_interface_def (AST_Interface *node);
00093   // Code encapsulated out of visit_interface().
00094 
00095   int create_value_def (AST_ValueType *node);
00096   // Code encapsulated out of visit_valuetype().
00097 
00098   int create_component_def (AST_Component *node);
00099   // Code encapsulated out of visit_component().
00100 
00101   int create_home_def (AST_Home *node);
00102   // Code encapsulated out of visit_home().
00103 
00104   int create_event_def (AST_EventType *node);
00105   // Code encapsulated out of visit_eventtype().
00106 
00107   int create_value_member (AST_Field *node);
00108   // Conditional call from visit_field().
00109 
00110   void get_referenced_type (AST_Type *node);
00111   // Utility method to update ir_current_ for struct members, union
00112   // members, operation parameters and operation return types.
00113 
00114   void fill_base_value (CORBA::ValueDef_ptr &result,
00115                         AST_ValueType *node);
00116 
00117   void fill_base_component (CORBA::ComponentIR::ComponentDef_ptr &result,
00118                             AST_Component *node);
00119 
00120   void fill_base_home (CORBA::ComponentIR::HomeDef_ptr &result,
00121                        AST_Home *node);
00122 
00123   void fill_managed_component (CORBA::ComponentIR::ComponentDef_ptr &result,
00124                                AST_Home *node);
00125 
00126   void fill_primary_key (CORBA::ValueDef_ptr &result,
00127                          AST_Home *node);
00128 
00129   void fill_abstract_base_values (CORBA::ValueDefSeq &result,
00130                                   AST_ValueType *node);
00131 
00132   void fill_inherited_interfaces (CORBA::InterfaceDefSeq &result,
00133                                   AST_Interface *node);
00134 
00135   void fill_supported_interfaces (CORBA::InterfaceDefSeq &result,
00136                                   AST_Interface *node);
00137 
00138   void fill_interfaces (CORBA::InterfaceDefSeq &result,
00139                         AST_Interface **list,
00140                         CORBA::Long length);
00141 
00142   void fill_initializers (CORBA::ExtInitializerSeq &result,
00143                           AST_ValueType *node);
00144 
00145   void fill_get_exceptions (CORBA::ExceptionDefSeq &result,
00146                             AST_Attribute *node);
00147 
00148   void fill_set_exceptions (CORBA::ExceptionDefSeq &result,
00149                             AST_Attribute *node);
00150 
00151   void fill_exceptions (CORBA::ExceptionDefSeq &result,
00152                         AST_Decl *node);
00153 
00154   void fill_exceptions (CORBA::ExceptionDefSeq &result,
00155                         UTL_ExceptList *list);
00156 
00157   void fill_params (CORBA::ParDescriptionSeq &result,
00158                     AST_Operation *node);
00159 
00160   void visit_all_provides (AST_Component *node,
00161                            CORBA::ComponentIR::ComponentDef_ptr c);
00162 
00163   void visit_all_uses (AST_Component *node,
00164                        CORBA::ComponentIR::ComponentDef_ptr c);
00165 
00166   void visit_all_emits (AST_Component *node,
00167                         CORBA::ComponentIR::ComponentDef_ptr c);
00168 
00169   void visit_all_publishes (AST_Component *node,
00170                             CORBA::ComponentIR::ComponentDef_ptr c);
00171 
00172   void visit_all_consumes (AST_Component *node,
00173                            CORBA::ComponentIR::ComponentDef_ptr c);
00174 
00175   void visit_all_factories (AST_Home *node,
00176                             CORBA::ComponentIR::HomeDef_ptr h);
00177 
00178   void visit_all_finders (AST_Home *node,
00179                           CORBA::ComponentIR::HomeDef_ptr h);
00180 
00181   void expand_id (ACE_CString &str,
00182                   const char *local_name);
00183 
00184 protected:
00185   CORBA::IDLType_var ir_current_;
00186   // Holder for the IR object most recently created or looked up by
00187   // the visitor. This makes it accessible by visitor methods that
00188   // need the result of a call to another visitor method that
00189   // creates an IR object.
00190 
00191   AST_Decl *scope_;
00192   // Store the node whose scope (if any) we will be visiting.
00193 
00194   bool in_reopened_;
00195   // Are we traversing the scope of a reopened module?
00196 };
00197 
00198 #endif /* TAO_IFR_ADDING_VISITOR_H */

Generated on Sun Jan 27 16:31:52 2008 for TAO_IFR by doxygen 1.3.6