2 //=============================================================================
6 * Extension of class AST_Home that provides additional means for C++
7 * mapping of a component home.
11 //=============================================================================
14 #include "be_component.h"
15 #include "be_visitor.h"
17 #include "ast_attribute.h"
19 #include "global_extern.h"
22 be_home::be_home (UTL_ScopedName
*n
,
24 AST_Component
*managed_component
,
25 AST_Type
*primary_key
,
28 AST_Interface
**supports_flat
,
32 AST_Decl (AST_Decl::NT_home
,
34 AST_Type (AST_Decl::NT_home
,
36 UTL_Scope (AST_Decl::NT_home
),
52 be_scope (AST_Decl::NT_home
),
53 be_decl (AST_Decl::NT_home
,
55 be_type (AST_Decl::NT_home
,
65 this->size_type (AST_Type::VARIABLE
);
67 // Some previous error may have caused a lookup failure, in which
68 // case we'll crash if we do the narrow below.
69 if (managed_component
== nullptr)
71 idl_global
->set_err_count (idl_global
->err_count () + 1);
76 dynamic_cast<be_component
*> (managed_component
);
78 bt
->seen_in_operation (true);
80 idl_global
->object_arg_seen_
= true;
88 be_home::scan (UTL_Scope
*s
)
95 for (UTL_ScopeActiveIterator
i (s
, UTL_Scope::IK_both
);
99 AST_Decl
*d
= i
.item ();
100 AST_Attribute
*attr
=
101 dynamic_cast<AST_Attribute
*> (d
);
103 if (attr
!= nullptr && ! attr
->readonly ())
105 this->has_rw_attributes_
= true;
110 AST_Home
*h
= dynamic_cast<AST_Home
*> (s
);
114 this->scan (h
->base_home ());
121 delete [] this->full_skel_name_
;
122 this->full_skel_name_
= nullptr;
124 delete [] this->full_coll_name_
;
125 this->full_coll_name_
= nullptr;
127 delete [] this->local_coll_name_
;
128 this->local_coll_name_
= nullptr;
130 delete [] this->relative_skel_name_
;
131 this->relative_skel_name_
= nullptr;
133 delete [] this->direct_proxy_impl_name_
;
134 this->direct_proxy_impl_name_
= nullptr;
136 delete [] this->full_direct_proxy_impl_name_
;
137 this->full_direct_proxy_impl_name_
= nullptr;
139 delete [] this->client_scope_
;
140 this->client_scope_
= nullptr;
142 delete [] this->flat_client_scope_
;
143 this->flat_client_scope_
= nullptr;
145 delete [] this->server_scope_
;
146 this->server_scope_
= nullptr;
148 delete [] this->flat_server_scope_
;
149 this->flat_server_scope_
= nullptr;
151 this->be_scope::destroy ();
152 this->be_type::destroy ();
154 // This skips AST_Interface, for the reason above.
155 this->AST_Home::destroy ();
159 be_home::accept (be_visitor
*visitor
)
161 return (idl_global
->ignore_idl3 ()
163 : visitor
->visit_home (this));