Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / TAO_IDL / include / ast_component.h
blob2a8e15758f30c885daa14c08285f603b68157ae6
1 // This may look like C, but it's really -*- C++ -*-
2 #ifndef _AST_COMPONENT_AST_COMPONENT_HH
3 #define _AST_COMPONENT_AST_COMPONENT_HH
5 #include "ast_interface.h"
6 #include "ace/Unbounded_Queue.h"
8 class AST_Provides;
9 class AST_Uses;
10 class AST_Publishes;
11 class AST_Emits;
12 class AST_Consumes;
13 class AST_Extended_Port;
14 class AST_Mirror_Port;
16 class TAO_IDL_FE_Export AST_Component
17 : public virtual AST_Interface
19 public:
20 AST_Component (UTL_ScopedName *n,
21 AST_Component *base_component,
22 AST_Type **supports,
23 long n_supports,
24 AST_Interface **supports_flat,
25 long n_supports_flat);
27 virtual ~AST_Component (void);
29 // This also calls the base class version.
30 virtual void redefine (AST_Interface *from);
32 // Extend lookup to the base component.
33 virtual AST_Decl *look_in_inherited (UTL_ScopedName *e,
34 bool full_def_only);
36 // Extend lookup to the supported interfaces.
37 virtual AST_Decl *look_in_supported (UTL_ScopedName *e,
38 bool full_def_only);
40 // Accessors.
42 AST_Component *base_component (void) const;
44 AST_Type **supports (void) const;
46 long n_supports (void) const;
48 // Override for component of UTL_Scope method.
49 virtual AST_Decl *special_lookup (UTL_ScopedName *e,
50 bool full_def_only,
51 AST_Decl *&final_parent_decl);
53 // Cleanup function.
54 virtual void destroy (void);
56 // Allows adding an uses to a later point
57 // The port i is inserted after port ix, if
58 // ix is not null.
59 int be_add_uses (AST_Uses *i,
60 AST_Uses *ix = 0);
62 // Narrowing.
64 DEF_NARROW_FROM_DECL (AST_Component);
65 DEF_NARROW_FROM_SCOPE (AST_Component);
67 // AST Dumping.
68 virtual void dump (ACE_OSTREAM_TYPE &);
70 // Visiting.
71 virtual int ast_accept (ast_visitor *visitor);
73 static AST_Decl::NodeType const NT;
74 typedef AST_ComponentFwd FWD_TYPE;
76 protected:
77 virtual AST_Provides *fe_add_provides (AST_Provides *p);
79 virtual AST_Uses *fe_add_uses (AST_Uses *p);
81 virtual AST_Publishes *fe_add_publishes (AST_Publishes *p);
83 virtual AST_Emits *fe_add_emits (AST_Emits *p);
85 virtual AST_Consumes *fe_add_consumes (AST_Consumes *p);
87 virtual AST_Extended_Port *fe_add_extended_port (AST_Extended_Port *p);
89 virtual AST_Mirror_Port *fe_add_mirror_port (AST_Mirror_Port *p);
91 protected:
92 AST_Component *pd_base_component;
95 #endif // _AST_COMPONENT_AST_COMPONENT_HH