Merge pull request #2303 from jwillemsen/jwi-803
[ACE_TAO.git] / TAO / TAO_IDL / include / ast_component.h
blobbe20b103a58234a4296dba4e52e36fdc7edf2416
1 #ifndef _AST_COMPONENT_AST_COMPONENT_HH
2 #define _AST_COMPONENT_AST_COMPONENT_HH
4 #include "ast_interface.h"
5 #include "ace/Unbounded_Queue.h"
7 class AST_Provides;
8 class AST_Uses;
9 class AST_Publishes;
10 class AST_Emits;
11 class AST_Consumes;
12 class AST_Extended_Port;
13 class AST_Mirror_Port;
15 class TAO_IDL_FE_Export AST_Component
16 : public virtual AST_Interface
18 public:
19 AST_Component (UTL_ScopedName *n,
20 AST_Component *base_component,
21 AST_Type **supports,
22 long n_supports,
23 AST_Interface **supports_flat,
24 long n_supports_flat);
26 virtual ~AST_Component ();
28 // This also calls the base class version.
29 virtual void redefine (AST_Interface *from);
31 // Extend lookup to the base component.
32 virtual AST_Decl *look_in_inherited (UTL_ScopedName *e,
33 bool full_def_only);
35 // Extend lookup to the supported interfaces.
36 virtual AST_Decl *look_in_supported (UTL_ScopedName *e,
37 bool full_def_only);
39 // Accessors.
41 AST_Component *base_component () const;
43 AST_Type **supports () const;
45 long n_supports () const;
47 // Override for component of UTL_Scope method.
48 virtual AST_Decl *special_lookup (UTL_ScopedName *e,
49 bool full_def_only,
50 AST_Decl *&final_parent_decl);
52 // Cleanup function.
53 virtual void destroy ();
55 // Allows adding an uses to a later point
56 // The port i is inserted after port ix, if
57 // ix is not null.
58 int be_add_uses (AST_Uses *i,
59 AST_Uses *ix = 0);
61 // AST Dumping.
62 virtual void dump (ACE_OSTREAM_TYPE &);
64 // Visiting.
65 virtual int ast_accept (ast_visitor *visitor);
67 static AST_Decl::NodeType const NT;
68 typedef AST_ComponentFwd FWD_TYPE;
70 protected:
71 virtual AST_Provides *fe_add_provides (AST_Provides *p);
73 virtual AST_Uses *fe_add_uses (AST_Uses *p);
75 virtual AST_Publishes *fe_add_publishes (AST_Publishes *p);
77 virtual AST_Emits *fe_add_emits (AST_Emits *p);
79 virtual AST_Consumes *fe_add_consumes (AST_Consumes *p);
81 virtual AST_Extended_Port *fe_add_extended_port (AST_Extended_Port *p);
83 virtual AST_Mirror_Port *fe_add_mirror_port (AST_Mirror_Port *p);
85 protected:
86 AST_Component *pd_base_component;
89 #endif // _AST_COMPONENT_AST_COMPONENT_HH