ifr_adding_visitor.h

Go to the documentation of this file.
00001 // $Id: ifr_adding_visitor.h 80536 2008-01-31 19:38:14Z cleeland $
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                       bool allow_duplicate_typedefs = false);
00046 
00047   virtual ~ifr_adding_visitor (void);
00048 
00049   virtual int visit_scope (UTL_Scope *node);
00050   virtual int visit_predefined_type (AST_PredefinedType *node);
00051   virtual int visit_module (AST_Module *node);
00052   virtual int visit_interface (AST_Interface *node);
00053   virtual int visit_interface_fwd (AST_InterfaceFwd *node);
00054   virtual int visit_valuebox (AST_ValueBox *node);
00055   virtual int visit_valuetype (AST_ValueType *node);
00056   virtual int visit_valuetype_fwd (AST_ValueTypeFwd *node);
00057   virtual int visit_component (AST_Component *node);
00058   virtual int visit_component_fwd (AST_ComponentFwd *node);
00059   virtual int visit_eventtype (AST_EventType *node);
00060   virtual int visit_eventtype_fwd (AST_EventTypeFwd *node);
00061   virtual int visit_home (AST_Home *node);
00062   virtual int visit_factory (AST_Factory *node);
00063   virtual int visit_structure (AST_Structure *node);
00064   virtual int visit_structure_fwd (AST_StructureFwd *node);
00065   virtual int visit_exception (AST_Exception *node);
00066   virtual int visit_enum (AST_Enum *node);
00067   virtual int visit_operation (AST_Operation *node);
00068   virtual int visit_field (AST_Field *node);
00069   virtual int visit_attribute (AST_Attribute *node);
00070   virtual int visit_union (AST_Union *node);
00071   virtual int visit_union_fwd (AST_UnionFwd *node);
00072   virtual int visit_constant (AST_Constant *node);
00073   virtual int visit_array (AST_Array *node);
00074   virtual int visit_sequence (AST_Sequence *node);
00075   virtual int visit_string (AST_String *node);
00076   virtual int visit_typedef (AST_Typedef *node);
00077   virtual int visit_root (AST_Root *node);
00078   virtual int visit_native (AST_Native *node);
00079 
00080 protected:
00081   CORBA::PrimitiveKind expr_type_to_pkind (AST_Expression::ExprType et);
00082   CORBA::PrimitiveKind predefined_type_to_pkind (AST_PredefinedType *node);
00083   // Conversion functions.
00084 
00085   void load_any (AST_Expression::AST_ExprValue *ev,
00086                  CORBA::Any &any);
00087   // Determine the primitive type and insert into the Any.
00088 
00089   void element_type (AST_Type *base_type, bool owned = false);
00090   // Creates or looks up the element type of an array or sequence,
00091   // and stores the result in ir_current_.
00092 
00093   int create_interface_def (AST_Interface *node);
00094   // Code encapsulated out of visit_interface().
00095 
00096   int create_value_def (AST_ValueType *node);
00097   // Code encapsulated out of visit_valuetype().
00098 
00099   int create_component_def (AST_Component *node);
00100   // Code encapsulated out of visit_component().
00101 
00102   int create_home_def (AST_Home *node);
00103   // Code encapsulated out of visit_home().
00104 
00105   int create_event_def (AST_EventType *node);
00106   // Code encapsulated out of visit_eventtype().
00107 
00108   int create_value_member (AST_Field *node);
00109   // Conditional call from visit_field().
00110 
00111   void get_referenced_type (AST_Type *node);
00112   // Utility method to update ir_current_ for struct members, union
00113   // members, operation parameters and operation return types.
00114 
00115   void fill_base_value (CORBA::ValueDef_ptr &result,
00116                         AST_ValueType *node);
00117 
00118   void fill_base_component (CORBA::ComponentIR::ComponentDef_ptr &result,
00119                             AST_Component *node);
00120 
00121   void fill_base_home (CORBA::ComponentIR::HomeDef_ptr &result,
00122                        AST_Home *node);
00123 
00124   void fill_managed_component (CORBA::ComponentIR::ComponentDef_ptr &result,
00125                                AST_Home *node);
00126 
00127   void fill_primary_key (CORBA::ValueDef_ptr &result,
00128                          AST_Home *node);
00129 
00130   void fill_abstract_base_values (CORBA::ValueDefSeq &result,
00131                                   AST_ValueType *node);
00132 
00133   void fill_inherited_interfaces (CORBA::InterfaceDefSeq &result,
00134                                   AST_Interface *node);
00135 
00136   void fill_supported_interfaces (CORBA::InterfaceDefSeq &result,
00137                                   AST_Interface *node);
00138 
00139   void fill_interfaces (CORBA::InterfaceDefSeq &result,
00140                         AST_Interface **list,
00141                         CORBA::Long length);
00142 
00143   void fill_initializers (CORBA::ExtInitializerSeq &result,
00144                           AST_ValueType *node);
00145 
00146   void fill_get_exceptions (CORBA::ExceptionDefSeq &result,
00147                             AST_Attribute *node);
00148 
00149   void fill_set_exceptions (CORBA::ExceptionDefSeq &result,
00150                             AST_Attribute *node);
00151 
00152   void fill_exceptions (CORBA::ExceptionDefSeq &result,
00153                         AST_Decl *node);
00154 
00155   void fill_exceptions (CORBA::ExceptionDefSeq &result,
00156                         UTL_ExceptList *list);
00157 
00158   void fill_params (CORBA::ParDescriptionSeq &result,
00159                     AST_Operation *node);
00160 
00161   void visit_all_provides (AST_Component *node,
00162                            CORBA::ComponentIR::ComponentDef_ptr c);
00163 
00164   void visit_all_uses (AST_Component *node,
00165                        CORBA::ComponentIR::ComponentDef_ptr c);
00166 
00167   void visit_all_emits (AST_Component *node,
00168                         CORBA::ComponentIR::ComponentDef_ptr c);
00169 
00170   void visit_all_publishes (AST_Component *node,
00171                             CORBA::ComponentIR::ComponentDef_ptr c);
00172 
00173   void visit_all_consumes (AST_Component *node,
00174                            CORBA::ComponentIR::ComponentDef_ptr c);
00175 
00176   void visit_all_factories (AST_Home *node,
00177                             CORBA::ComponentIR::HomeDef_ptr h);
00178 
00179   void visit_all_finders (AST_Home *node,
00180                           CORBA::ComponentIR::HomeDef_ptr h);
00181 
00182   void expand_id (ACE_CString &str,
00183                   const char *local_name);
00184 
00185 protected:
00186   CORBA::IDLType_var ir_current_;
00187   // Holder for the IR object most recently created or looked up by
00188   // the visitor. This makes it accessible by visitor methods that
00189   // need the result of a call to another visitor method that
00190   // creates an IR object.
00191 
00192   AST_Decl *scope_;
00193   // Store the node whose scope (if any) we will be visiting.
00194 
00195   bool in_reopened_;
00196   // Are we traversing the scope of a reopened module?
00197 
00198   bool allow_duplicate_typedefs_;
00199   // Do we allow duplicate typedefs?
00200 };
00201 
00202 #endif /* TAO_IFR_ADDING_VISITOR_H */

Generated on Tue Feb 2 17:50:49 2010 for TAO_IFR by  doxygen 1.4.7