Merge pull request #2303 from jwillemsen/jwi-803
[ACE_TAO.git] / TAO / TAO_IDL / be_include / be_component.h
blob09766163811c8c7a346c3a55ff46de131fbe45ec
1 /* -*- c++ -*- */
3 //=============================================================================
4 /**
5 * @file be_component.h
7 * Extension of class AST_Component that provides additional means for C++
8 * mapping of an interface.
10 * @author Jeff Parsons
12 //=============================================================================
14 #ifndef TAO_BE_COMPONENT_H
15 #define TAO_BE_COMPONENT_H
17 #include "be_interface.h"
18 #include "ast_component.h"
20 class AST_PortType;
22 /**
23 * The back end extension of the AST_Component class
25 class be_component : public virtual AST_Component,
26 public virtual be_interface
28 public:
29 be_component (UTL_ScopedName *n,
30 AST_Component *base_component,
31 AST_Type **supports,
32 long n_supports,
33 AST_Interface **supports_flat,
34 long n_supports_flat);
36 ~be_component ();
38 /// Override of the AST method to eliminate narrowing of
39 /// the return value. Non-virtual.
40 be_component *base_component () const;
42 /// Catch BE-specific members before delegating to the base class.
43 virtual void redefine (AST_Interface *from);
45 /// Cleanup function.
46 virtual void destroy ();
48 /// Visiting.
49 virtual int accept (be_visitor *visitor);
51 // Need for public access to fe_add_structure and fe_add_typedef,
52 // used to add implied IDL nodes created for 'uses multiple' declarations.
53 AST_Structure *be_add_structure (AST_Structure *t);
54 AST_Typedef *be_add_typedef (AST_Typedef *t);
56 ACE_CDR::ULong n_provides () const;
57 ACE_CDR::ULong n_remote_provides () const;
58 ACE_CDR::ULong n_uses () const;
59 ACE_CDR::ULong n_remote_uses () const;
60 bool has_uses_multiple () const;
61 ACE_CDR::ULong n_publishes () const;
62 ACE_CDR::ULong n_consumes () const;
63 ACE_CDR::ULong n_emits () const;
65 /// Update the has_* members.
66 void scan (UTL_Scope *s);
68 /// Generate the "public virtual" entries in the stub header.
69 virtual void gen_stub_inheritance (TAO_OutStream *os);
71 /// Generate the "public virtual" entries in the skel header.
72 virtual void gen_skel_inheritance (TAO_OutStream *os);
74 /// Generate the string compares for ancestors in _is_a().
75 virtual int gen_is_a_ancestors (TAO_OutStream *os);
77 private:
78 /// Specialized version for mirror ports.
79 void mirror_scan (AST_PortType *p);
81 private:
82 /// Used by visitors to reduce footprint.
83 ACE_CDR::ULong n_provides_;
84 ACE_CDR::ULong n_remote_provides_;
85 ACE_CDR::ULong n_uses_;
86 ACE_CDR::ULong n_remote_uses_;
87 bool has_uses_multiple_;
88 ACE_CDR::ULong n_publishes_;
89 ACE_CDR::ULong n_consumes_;
90 ACE_CDR::ULong n_emits_;
93 #endif // if !defined