Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / TAO_IDL / be_include / be_component.h
blob8871023c2dae6e3ad8ee3d3a5a052c29b7c5bbe5
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 (void);
38 /// Override of the AST method to eliminate narrowing of
39 /// the return value. Non-virtual.
40 be_component *base_component (void) 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 (void);
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 (void) const;
57 ACE_CDR::ULong n_remote_provides (void) const;
58 ACE_CDR::ULong n_uses (void) const;
59 ACE_CDR::ULong n_remote_uses (void) const;
60 bool has_uses_multiple (void) const;
61 ACE_CDR::ULong n_publishes (void) const;
62 ACE_CDR::ULong n_consumes (void) const;
63 ACE_CDR::ULong n_emits (void) 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 // Narrowing.
79 DEF_NARROW_FROM_DECL (be_component);
80 DEF_NARROW_FROM_SCOPE (be_component);
82 private:
83 /// Specialized version for mirror ports.
84 void mirror_scan (AST_PortType *p);
86 private:
87 /// Used by visitors to reduce footprint.
88 ACE_CDR::ULong n_provides_;
89 ACE_CDR::ULong n_remote_provides_;
90 ACE_CDR::ULong n_uses_;
91 ACE_CDR::ULong n_remote_uses_;
92 bool has_uses_multiple_;
93 ACE_CDR::ULong n_publishes_;
94 ACE_CDR::ULong n_consumes_;
95 ACE_CDR::ULong n_emits_;
98 #endif // if !defined