diff options
Diffstat (limited to 'TAO/TAO_IDL/be_include/be_interface.h')
-rw-r--r-- | TAO/TAO_IDL/be_include/be_interface.h | 283 |
1 files changed, 143 insertions, 140 deletions
diff --git a/TAO/TAO_IDL/be_include/be_interface.h b/TAO/TAO_IDL/be_include/be_interface.h index 4319edece05..c7b3c94b4af 100644 --- a/TAO/TAO_IDL/be_include/be_interface.h +++ b/TAO/TAO_IDL/be_include/be_interface.h @@ -1,20 +1,26 @@ // -*- C++ -*- - -//============================================================================= -/** - * @file be_interface.h - * - * $Id$ - * - * Extension of class AST_Interface that provides additional means for C++ - * mapping of an interface. - * - * - * @author Copyright 1994-1995 by Sun Microsystems - * @author Inc. and Aniruddha Gokhale - * @author Michael Kircher - */ -//============================================================================= +// +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// TAO_IDL_BE +// +// = FILENAME +// be_interface.h +// +// = DESCRIPTION +// Extension of class AST_Interface that provides additional means for C++ +// mapping of an interface. +// +// = AUTHOR +// Copyright 1994-1995 by Sun Microsystems, Inc. +// and +// Aniruddha Gokhale, +// Michael Kircher +// +// ============================================================================ #ifndef TAO_BE_INTERFACE_H #define TAO_BE_INTERFACE_H @@ -52,6 +58,9 @@ public: be_interface *, TAO_OutStream *); + be_interface (void); + // Default constructor. + be_interface (UTL_ScopedName *n, AST_Type **ih, long nih, @@ -59,107 +68,109 @@ public: long nih_flat, bool local, bool abstract); + // Constructor that sets its scoped name <n>, a list of inherited interfaces + // <ih>, the number of inherited interfaces <nih>, and any prgmas <p>. - /// Destructor. ~be_interface (void); + // Destructor. - /// Set the strategy to generate the names. be_interface_strategy *set_strategy (be_interface_strategy *new_strategy); + // Set the strategy to generate the names. // Methods, which access the strategy. - /// Return the local name. const char *local_name (void) const; + // Return the local name. - /// Return the stringified full name. virtual const char *full_name (void); + // Return the stringified full name. - /// Return the flattened full scoped name. virtual const char *flat_name (void); + // Return the flattened full scoped name. - /// Retrieve the repository ID. virtual const char *repoID (void) const; + // Retrieve the repository ID. - /// Retrieve the fully scoped skel class name. const char *full_skel_name (void) const; + // Retrieve the fully scoped skel class name. - /// Retrieve the fully qualified collocated class name. const char *full_coll_name (int) const; + // Retrieve the fully qualified collocated class name. - /// Retrieve the fully qualified collocated class name. const char *local_coll_name (int) const; + // Retrieve the fully qualified collocated class name. - /// retrieve the name of the base proxy implementation. virtual const char *base_proxy_impl_name (void); + // retrieve the name of the base proxy implementation. - /// retrieve the fully qualified name of the base proxy - /// implementation. virtual const char *full_base_proxy_impl_name (void); + // retrieve the fully qualified name of the base proxy + // implementation. - /// retrieve the name of the remote proxy implementation. virtual const char *remote_proxy_impl_name (void); + // retrieve the name of the remote proxy implementation. - /// retrieve the fully qualified name of the remote - /// proxy implementation. virtual const char *full_remote_proxy_impl_name (void); + // retrieve the fully qualified name of the remote + // proxy implementation. - /// retrieve the name of the Directx proxy implementation. virtual const char *direct_proxy_impl_name (void); + // retrieve the name of the Directx proxy implementation. - /// retrieve the fully qualified name of the Directx proxy - /// implementation. virtual const char *full_direct_proxy_impl_name (void); + // retrieve the fully qualified name of the Directx proxy + // implementation. - /// retrieve the name of the base proxy broker. virtual const char *base_proxy_broker_name (void); + // retrieve the name of the base proxy broker. - /// retrieve the fully qualified name of the base proxy broker. virtual const char *full_base_proxy_broker_name (void); + // retrieve the fully qualified name of the base proxy broker. - /// retrieve the name of the remote proxy broker implementation. virtual const char *remote_proxy_broker_name (void); + // retrieve the name of the remote proxy broker implementation. - /// retrieve the fully qualified name of the remote proxy broker - /// implementation. virtual const char *full_remote_proxy_broker_name (void); + // retrieve the fully qualified name of the remote proxy broker + // implementation. - /// retrieve the name of the strategized proxy broker implementation. virtual const char *strategized_proxy_broker_name (void); + // retrieve the name of the strategized proxy broker implementation. - /// retrieve the fully qualified name of the strategized proxy broker - /// implementation. virtual const char *full_strategized_proxy_broker_name (void); + // retrieve the fully qualified name of the strategized proxy broker + // implementation. - /// Return the client scope that encloses the interface. virtual const char *client_enclosing_scope (void); + // Return the client scope that encloses the interface. - /// Return the "flattened" scope that encloses - /// the interface. virtual const char *flat_client_enclosing_scope (void); + // Return the "flattened" scope that encloses + // the interface. - /// Return the server scope that encloses the interface. virtual const char *server_enclosing_scope (void); + // Return the server scope that encloses the interface. - /// Retrieve skeleton name. const char *relative_skel_name (const char *skel_name); + // Retrieve skeleton name. - /// Build up the skeleton name. void compute_full_skel_name (const char *prefix, char *&skel_name); + // Build up the skeleton name. static const char *relative_name (const char *localname, const char *othername); - /// Call the default constructors of all the base classes. virtual void gen_def_ctors (TAO_OutStream* os); + // Call the default constructors of all the base classes. - /// Generated the global hooks used for non-defined forward - /// declared interfaces, and the contructor from stub object. virtual void gen_stub_ctor (TAO_OutStream* os); + // Generated the global hooks used for non-defined forward + // declared interfaces, and the contructor from stub object. - /// Generate the declarations used by the template _var, _out - /// classes for interfaces, and by sequence template classes. void gen_var_out_seq_decls (void); + // Generate the declarations used by the template _var, _out + // classes for interfaces, and by sequence template classes. // Each interface (to fix names "T") also defines two help classes, // the "collocated" class inherits from T, but delegates on the @@ -194,22 +205,20 @@ public: bool abstract_paths_only = false, bool add_ccm_object = true); - /** - * Am I in some form of multiple inheritance - * -1 => error - * 0 => no - * 1 => yes - */ int in_mult_inheritance (void); + // Am I in some form of multiple inheritance + // -1 => error + // 0 => no + // 1 => yes - /// Set a new value. void in_mult_inheritance (int mi); + // Set a new value. - /// Pass along BE-specific member values when redefining a fwd decl. virtual void redefine (AST_Interface *from); + // Pass along BE-specific member values when redefining a fwd decl. - /// Cleanup function. virtual void destroy (void); + // Cleanup function. // Visiting. virtual int accept (be_visitor *visitor); @@ -219,47 +228,47 @@ public: DEF_NARROW_FROM_DECL (be_interface); DEF_NARROW_FROM_SCOPE (be_interface); - /// Helper method passed to the template method that generates code for the - /// is_a method. static int is_a_helper (be_interface *, be_interface *, TAO_OutStream *os); + // Helper method passed to the template method that generates code for the + // is_a method. - /// Helper method passed to the template method to generate code for the - /// operation table. static int ami_handler_gen_optable_helper (be_interface *, be_interface *, TAO_OutStream *os); + // Helper method passed to the template method to generate code for the + // operation table. - /// Helper method passed to the template method to generate code for the - /// skeletons in the header and inline files. static int gen_skel_helper (be_interface *, be_interface *, TAO_OutStream *); + // Helper method passed to the template method to generate code for the + // skeletons in the header and inline files. - /// Helper method passed to the template method to generate code for the - /// collocated functions in the header file. static int gen_colloc_op_decl_helper (be_interface *derived, be_interface *ancestor, TAO_OutStream *os); + // Helper method passed to the template method to generate code for the + // collocated functions in the header file. - /// Helper method passed to the template method to generate code for the - /// collocated functions in the source file. static int gen_colloc_op_defn_helper (be_interface *derived, be_interface *ancestor, TAO_OutStream *os); + // Helper method passed to the template method to generate code for the + // collocated functions in the source file. - /// Helper method passed to the template method to invoke ctors of all the - /// base classes. static int copy_ctor_helper (be_interface *, be_interface *, TAO_OutStream *os); + // Helper method passed to the template method to invoke ctors of all the + // base classes. - /// Helper method to determine if the interface node is involved in some kind - /// of multiple inheritance or not. Required on the skeleton side. static int in_mult_inheritance_helper (be_interface *, be_interface *, TAO_OutStream *os); + // Helper method to determine if the interface node is involved in some kind + // of multiple inheritance or not. Required on the skeleton side. static int gen_def_ctors_helper (be_interface *node, be_interface *base, @@ -268,11 +277,11 @@ public: // Helper method to generate a call to the default // constructors of all the base classes. - /// Helper method to initialize the obj_ member of each generated abstract - /// base class. static int gen_abstract_init_helper (be_interface *node, be_interface *base, TAO_OutStream *os); + // Helper method to initialize the obj_ member of each generated abstract + // base class. /// Helper method passed to traverse_inheritance_graph(), /// collects supported operations and attributes. @@ -280,20 +289,19 @@ public: be_interface *base, TAO_OutStream *os); - /// Generate the operation table including entries for inherited interfaces. int gen_operation_table (const char *flat_name, const char *skeleton_class_name); + // Generate the operation table including entries for inherited interfaces. - /// generate the operation table entries. int gen_optable_entries (be_interface *derived_interface, const char *full_skeleton_name, TAO_OutStream *os); + // generate the operation table entries. - /// If we are local, regenerate non-local base class operations as - /// pure virtual. int convert_parent_ops (be_visitor *visitor); + // If we are local, regenerate non-local base class operations as + // pure virtual. - /// Common code called from gen_colloc_op_defn_helper(). static void gen_collocated_skel_body (be_interface *derived, be_interface *ancestor, AST_Decl *d, @@ -301,137 +309,132 @@ public: bool direct, UTL_ExceptList *list, TAO_OutStream *os); + // Common code called from gen_colloc_op_defn_helper(). - /// Overridden from class be_type. virtual void gen_ostream_operator (TAO_OutStream *os, bool use_underscore); + // Overridden from class be_type. - /// Overridden from class be_type. virtual void gen_member_ostream_operator (TAO_OutStream *os, const char *instance_name, bool use_underscore, bool accessor = false); + // Overridden from class be_type. - /// Compute whether or not we have both abstract and concrete parents, - /// and make a list of the abstract parents, if any. void analyze_parentage (void); + // Compute whether or not we have both abstract and concrete parents, + // and make a list of the abstract parents, if any. - /// Find the next state, used to hide differences between variants of - /// interfaces. TAO_CodeGen::CG_STATE next_state (TAO_CodeGen::CG_STATE current_state, int is_extra_state = 0); + // Find the next state, used to hide differences between variants of + // interfaces. - /// Returns 1 if additional code needs to be generated, the behavior - /// is driven by the strategy connected with this interface. int has_extra_code_generation (TAO_CodeGen::CG_STATE current_state); + // Returns 1 if additional code needs to be generated, the behavior + // is driven by the strategy connected with this interface. - /// Sets the original interface from which this one was created, - /// applies only to implied IDL. void original_interface (be_interface *original_interface); + // Sets the original interface from which this one was created, + // applies only to implied IDL. - /// Returns the original interface from which this one was created, - /// applies only to implied IDL be_interface *original_interface (); + // Returns the original interface from which this one was created, + // applies only to implied IDL - /// Returns an interface, which can be used instead. - /// Needs to get set by the strategy. be_interface *replacement (); + // Returns an interface, which can be used instead. + // Needs to get set by the strategy. - /// Do we have both abstract and concrete parents? int has_mixed_parentage (void); + // Do we have both abstract and concrete parents? - /// Is Components::SessionComponent an immediate parent? int session_component_child (void); + // Is Components::SessionComponent an immediate parent? - /// Is EventConsumerBase our parent? bool is_event_consumer (void); + // Is EventConsumerBase our parent? - /** - * Common code for facet generation, whether we are - * navigating from the component port or forcing - * facet generation for all interfaces. - */ void gen_facet_idl (TAO_OutStream &os); int gen_facet_svnt_hdr (be_visitor *visitor, TAO_OutStream &os); int gen_facet_svnt_src (be_visitor *visitor, TAO_OutStream &os); + // Common code for facet generation, whether we are + // navigating from the component port or forcing + // facet generation for all interfaces. - /// Helper function called from visitors and used internally. void gen_nesting_open (TAO_OutStream &os); void gen_nesting_close (TAO_OutStream &os); + // Helper function called from visitors and used internally. private: - /// Output the header (type declaration and %%) to the gperf's input - /// file. void gen_gperf_input_header (TAO_OutStream *ss); + // Output the header (type declaration and %%) to the gperf's input + // file. - /** - * Run GPERF and get the correct lookup and other operations - * depending on which strategy we are using. Returns 0 on sucess, -1 - * on error. - */ int gen_gperf_things (const char *flat_name); + // Run GPERF and get the correct lookup and other operations + // depending on which strategy we are using. Returns 0 on sucess, -1 + // on error. - /// Outputs the class definition for the perfect hashing. This class - /// will inherit from the TAO_Perfect_Hash_OpTable. void gen_perfect_hash_class_definition (const char *flat_name); + // Outputs the class definition for the perfect hashing. This class + // will inherit from the TAO_Perfect_Hash_OpTable. - /// Outputs the class definition for the binary search . This class - /// will inherit from the TAO_Binary_Search_OpTable. void gen_binary_search_class_definition (const char *flat_name); + // Outputs the class definition for the binary search . This class + // will inherit from the TAO_Binary_Search_OpTable. - /// Outputs the class defintion for the linear search. This class - /// will inherit from the TAO_Linear_Search. void gen_linear_search_class_definition (const char *flat_name); + // Outputs the class defintion for the linear search. This class + // will inherit from the TAO_Linear_Search. - /// This calls the GPERF program and gets the correct operation - /// lookup methods for the current OpLookup strategy. int gen_gperf_lookup_methods (const char *flat_name); + // This calls the GPERF program and gets the correct operation + // lookup methods for the current OpLookup strategy. - /// Create an instance of this perfect hash table. void gen_perfect_hash_instance (const char *flat_name); + // Create an instance of this perfect hash table. - /// Create an instance of the binary search optable. void gen_binary_search_instance (const char *flat_name); + // Create an instance of the binary search optable. - /// Create an instance of the linear search optable. void gen_linear_search_instance (const char *flat_name); + // Create an instance of the linear search optable. - /** - * Called from traverse_inheritance_graph(), since base - * components and base homes are inserted before the actual - * traversal, it must be done tail-recursively to get the - * chain of parents in the correct order when generating - * copy constructors etc. - */ void enqueue_base_component_r (AST_Component *node); void enqueue_base_home_r (AST_Home *node); + // Called from traverse_inheritance_graph(), since base + // components and base homes are inserted before the actual + // traversal, it must be done tail-recursively to get the + // chain of parents in the correct order when generating + // copy constructors etc. protected: - /// Have these been done already? int var_out_seq_decls_gen_; + // Have these been done already? protected: - /// Number of static skeletons in the operation table. int skel_count_; + // Number of static skeletons in the operation table. - /// Am I directly or indirectly involved in a multiple inheritance. If the - /// value is -1 => not computed yet. int in_mult_inheritance_; + // Am I directly or indirectly involved in a multiple inheritance. If the + // value is -1 => not computed yet. - /// Member for holding the strategy for generating names. be_interface_strategy *strategy_; + // Member for holding the strategy for generating names. - /// The original interface from which this one was created, - /// applies only to implied IDL be_interface *original_interface_; + // The original interface from which this one was created, + // applies only to implied IDL - /// Do we have both abstract and concrete parents? int has_mixed_parentage_; + // Do we have both abstract and concrete parents? - /// Are we a direct child of Components::SessionComponent? int session_component_child_; + // Are we a direct child of Components::SessionComponent? }; /** |