1*1c78a5d6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*1c78a5d6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*1c78a5d6SAndrew Rist * or more contributor license agreements. See the NOTICE file
5*1c78a5d6SAndrew Rist * distributed with this work for additional information
6*1c78a5d6SAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*1c78a5d6SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*1c78a5d6SAndrew Rist * "License"); you may not use this file except in compliance
9*1c78a5d6SAndrew Rist * with the License. You may obtain a copy of the License at
10cdf0e10cSrcweir *
11*1c78a5d6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir *
13*1c78a5d6SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*1c78a5d6SAndrew Rist * software distributed under the License is distributed on an
15*1c78a5d6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1c78a5d6SAndrew Rist * KIND, either express or implied. See the License for the
17*1c78a5d6SAndrew Rist * specific language governing permissions and limitations
18*1c78a5d6SAndrew Rist * under the License.
19cdf0e10cSrcweir *
20*1c78a5d6SAndrew Rist *************************************************************/
21*1c78a5d6SAndrew Rist
22*1c78a5d6SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir #ifndef ARY_IDL_IA_CE_HXX
25cdf0e10cSrcweir #define ARY_IDL_IA_CE_HXX
26cdf0e10cSrcweir
27cdf0e10cSrcweir
28cdf0e10cSrcweir // USED SERVICES
29cdf0e10cSrcweir // BASE CLASSES
30cdf0e10cSrcweir #include <ary/idl/ip_ce.hxx>
31cdf0e10cSrcweir // COMPONENTS
32cdf0e10cSrcweir // PARAMETERS
33cdf0e10cSrcweir
34cdf0e10cSrcweir
35cdf0e10cSrcweir namespace ary
36cdf0e10cSrcweir {
37cdf0e10cSrcweir namespace idl
38cdf0e10cSrcweir {
39cdf0e10cSrcweir
40cdf0e10cSrcweir class Ce_Storage;
41cdf0e10cSrcweir class TypeAdmin;
42cdf0e10cSrcweir
43cdf0e10cSrcweir
44cdf0e10cSrcweir /** @resp
45cdf0e10cSrcweir Implements ::ary::idl::CePilot. Provides the access logic for all
46cdf0e10cSrcweir IDL code entities.
47cdf0e10cSrcweir
48cdf0e10cSrcweir @collab Ce_Storage
49cdf0e10cSrcweir @collab TypeAdmin
50cdf0e10cSrcweir
51cdf0e10cSrcweir @see CodeEntity
52cdf0e10cSrcweir */
53cdf0e10cSrcweir class CeAdmin : public CePilot
54cdf0e10cSrcweir {
55cdf0e10cSrcweir public:
56cdf0e10cSrcweir // LIFECYCLE
57cdf0e10cSrcweir CeAdmin(
58cdf0e10cSrcweir NameLookup & io_rNameDictionary,
59cdf0e10cSrcweir TypeAdmin & io_rTypePilot );
60cdf0e10cSrcweir virtual ~CeAdmin();
61cdf0e10cSrcweir
62cdf0e10cSrcweir // OPERATIONS
63cdf0e10cSrcweir
64cdf0e10cSrcweir // INQUIRY
65cdf0e10cSrcweir const Ce_Storage & Storage() const;
66cdf0e10cSrcweir
67cdf0e10cSrcweir // ACCESS
68cdf0e10cSrcweir Ce_Storage & Storage();
69cdf0e10cSrcweir
70cdf0e10cSrcweir // INHERITED
71cdf0e10cSrcweir // Interface ::ary::idl::CePilot:
72cdf0e10cSrcweir virtual Module & CheckIn_Module(
73cdf0e10cSrcweir Ce_id i_nParentId,
74cdf0e10cSrcweir const String & i_sName );
75cdf0e10cSrcweir virtual Service & Store_Service(
76cdf0e10cSrcweir Ce_id i_nOwner,
77cdf0e10cSrcweir const String & i_sName );
78cdf0e10cSrcweir virtual SglIfcService &
79cdf0e10cSrcweir Store_SglIfcService(
80cdf0e10cSrcweir Ce_id i_nOwner,
81cdf0e10cSrcweir const String & i_sName,
82cdf0e10cSrcweir Type_id i_nBaseInterface );
83cdf0e10cSrcweir virtual Interface & Store_Interface(
84cdf0e10cSrcweir Ce_id i_nOwner,
85cdf0e10cSrcweir const String & i_sName,
86cdf0e10cSrcweir Type_id i_nBase );
87cdf0e10cSrcweir virtual Struct & Store_Struct(
88cdf0e10cSrcweir Ce_id i_nOwner,
89cdf0e10cSrcweir const String & i_sName,
90cdf0e10cSrcweir Type_id i_nBase,
91cdf0e10cSrcweir const String & i_sTemplateParam );
92cdf0e10cSrcweir virtual Exception & Store_Exception(
93cdf0e10cSrcweir Ce_id i_nOwner,
94cdf0e10cSrcweir const String & i_sName,
95cdf0e10cSrcweir Type_id i_nBase );
96cdf0e10cSrcweir virtual Enum & Store_Enum(
97cdf0e10cSrcweir Ce_id i_nOwner,
98cdf0e10cSrcweir const String & i_sName );
99cdf0e10cSrcweir virtual Typedef & Store_Typedef(
100cdf0e10cSrcweir Ce_id i_nOwner,
101cdf0e10cSrcweir const String & i_sName,
102cdf0e10cSrcweir Type_id i_nDefiningType );
103cdf0e10cSrcweir virtual ConstantsGroup &
104cdf0e10cSrcweir Store_ConstantsGroup(
105cdf0e10cSrcweir Ce_id i_nOwner,
106cdf0e10cSrcweir const String & i_sName );
107cdf0e10cSrcweir virtual Singleton & Store_Singleton(
108cdf0e10cSrcweir Ce_id i_nOwner,
109cdf0e10cSrcweir const String & i_sName );
110cdf0e10cSrcweir virtual SglIfcSingleton &
111cdf0e10cSrcweir Store_SglIfcSingleton(
112cdf0e10cSrcweir Ce_id i_nOwner,
113cdf0e10cSrcweir const String & i_sName,
114cdf0e10cSrcweir Type_id i_nBaseInterface );
115cdf0e10cSrcweir
116cdf0e10cSrcweir virtual Constant & Store_Constant(
117cdf0e10cSrcweir Ce_id i_nOwner,
118cdf0e10cSrcweir const String & i_sName,
119cdf0e10cSrcweir Type_id i_nType,
120cdf0e10cSrcweir const String & i_sValue );
121cdf0e10cSrcweir virtual Property & Store_Property(
122cdf0e10cSrcweir Ce_id i_nOwner,
123cdf0e10cSrcweir const String & i_sName,
124cdf0e10cSrcweir Type_id i_nType,
125cdf0e10cSrcweir Property::Stereotypes
126cdf0e10cSrcweir i_stereotypes );
127cdf0e10cSrcweir virtual Function & Store_Function(
128cdf0e10cSrcweir Ce_id i_nOwner,
129cdf0e10cSrcweir const String & i_sName,
130cdf0e10cSrcweir Type_id i_nReturnType,
131cdf0e10cSrcweir bool i_bOneWay );
132cdf0e10cSrcweir virtual Function & Store_ServiceConstructor(
133cdf0e10cSrcweir Ce_id i_nOwner,
134cdf0e10cSrcweir const String & i_sName );
135cdf0e10cSrcweir virtual StructElement &
136cdf0e10cSrcweir Store_StructMember(
137cdf0e10cSrcweir Ce_id i_nOwner,
138cdf0e10cSrcweir const String & i_sName,
139cdf0e10cSrcweir Type_id i_nType );
140cdf0e10cSrcweir virtual StructElement &
141cdf0e10cSrcweir Store_ExceptionMember(
142cdf0e10cSrcweir Ce_id i_nOwner,
143cdf0e10cSrcweir const String & i_sName,
144cdf0e10cSrcweir Type_id i_nType );
145cdf0e10cSrcweir virtual EnumValue & Store_EnumValue(
146cdf0e10cSrcweir Ce_id i_nOwner,
147cdf0e10cSrcweir const String & i_sName,
148cdf0e10cSrcweir const String & i_sValue );
149cdf0e10cSrcweir virtual Attribute & Store_Attribute(
150cdf0e10cSrcweir Ce_id i_nOwner,
151cdf0e10cSrcweir const String & i_sName,
152cdf0e10cSrcweir Type_id i_nType,
153cdf0e10cSrcweir bool i_bReadOnly,
154cdf0e10cSrcweir bool i_bBound );
155cdf0e10cSrcweir
156cdf0e10cSrcweir virtual const Module &
157cdf0e10cSrcweir GlobalNamespace() const;
158cdf0e10cSrcweir virtual const CodeEntity &
159cdf0e10cSrcweir Find_Ce(
160cdf0e10cSrcweir Ce_id i_nId ) const;
161cdf0e10cSrcweir virtual const Module &
162cdf0e10cSrcweir Find_Module(
163cdf0e10cSrcweir Ce_id i_nId ) const;
164cdf0e10cSrcweir virtual const Module *
165cdf0e10cSrcweir Search_Module(
166cdf0e10cSrcweir Ce_id i_nId ) const;
167cdf0e10cSrcweir virtual const Function &
168cdf0e10cSrcweir Find_Function(
169cdf0e10cSrcweir Ce_id i_nId ) const;
170cdf0e10cSrcweir virtual const Property &
171cdf0e10cSrcweir Find_Property(
172cdf0e10cSrcweir Ce_id i_nId ) const;
173cdf0e10cSrcweir virtual const EnumValue &
174cdf0e10cSrcweir Find_EnumValue(
175cdf0e10cSrcweir Ce_id i_nId ) const;
176cdf0e10cSrcweir virtual const Constant &
177cdf0e10cSrcweir Find_Constant(
178cdf0e10cSrcweir Ce_id i_nId ) const;
179cdf0e10cSrcweir virtual const StructElement &
180cdf0e10cSrcweir Find_StructElement(
181cdf0e10cSrcweir Ce_id i_nId ) const;
182cdf0e10cSrcweir virtual void Get_Text(
183cdf0e10cSrcweir StringVector & o_module,
184cdf0e10cSrcweir String & o_ce,
185cdf0e10cSrcweir String & o_member,
186cdf0e10cSrcweir const CodeEntity & i_ce ) const;
187cdf0e10cSrcweir virtual const NameLookup &
188cdf0e10cSrcweir NameDictionary() const;
189cdf0e10cSrcweir virtual void Get_AlphabeticalIndex(
190cdf0e10cSrcweir std::vector<Ce_id> &
191cdf0e10cSrcweir o_rResult,
192cdf0e10cSrcweir alphabetical_index::E_Letter
193cdf0e10cSrcweir i_cLetter) const;
194cdf0e10cSrcweir // ACCESS
195cdf0e10cSrcweir virtual Module & GlobalNamespace();
196cdf0e10cSrcweir virtual CodeEntity &
197cdf0e10cSrcweir Find_Ce(
198cdf0e10cSrcweir Ce_id i_nId );
199cdf0e10cSrcweir private:
200cdf0e10cSrcweir // Locals
201cdf0e10cSrcweir Module & lhf_Access_Module(
202cdf0e10cSrcweir Ce_id i_nId );
203cdf0e10cSrcweir void lhf_Put2Storage_and_AssignId(
204cdf0e10cSrcweir CodeEntity & pass_io_rCe );
205cdf0e10cSrcweir void lhf_Store_NewEntity(
206cdf0e10cSrcweir DYN CodeEntity & pass_io_rCe,
207cdf0e10cSrcweir Module & i_rOwner );
208cdf0e10cSrcweir void lhf_Store_NewEntity(
209cdf0e10cSrcweir DYN CodeEntity & pass_io_rCe,
210cdf0e10cSrcweir Ce_id i_nOwnerModule );
211cdf0e10cSrcweir void get_ModuleText(
212cdf0e10cSrcweir StringVector & o_module,
213cdf0e10cSrcweir const CodeEntity & i_ce ) const;
214cdf0e10cSrcweir Struct & lhf_Store_TplStruct(
215cdf0e10cSrcweir Ce_id i_nOwner,
216cdf0e10cSrcweir const String & i_sName,
217cdf0e10cSrcweir Type_id i_nBase,
218cdf0e10cSrcweir const String & i_sTemplateParam );
219cdf0e10cSrcweir
220cdf0e10cSrcweir const Ce_Storage & my_Storage() const;
221cdf0e10cSrcweir Ce_Storage & my_Storage();
my_NameDictionary()222cdf0e10cSrcweir NameLookup & my_NameDictionary() { return *pNameDictionary; }
223cdf0e10cSrcweir
224cdf0e10cSrcweir // DATA
225cdf0e10cSrcweir Dyn<Ce_Storage> pStorage; /// @inv pStorage != 0;
226cdf0e10cSrcweir Module * pGlobalNamespace;
227cdf0e10cSrcweir NameLookup * pNameDictionary;
228cdf0e10cSrcweir TypeAdmin * pTypePilot;
229cdf0e10cSrcweir };
230cdf0e10cSrcweir
231cdf0e10cSrcweir
232cdf0e10cSrcweir // IMPLEMENTATION
233cdf0e10cSrcweir inline const Ce_Storage &
Storage() const234cdf0e10cSrcweir CeAdmin::Storage() const
235cdf0e10cSrcweir {
236cdf0e10cSrcweir return *pStorage;
237cdf0e10cSrcweir }
238cdf0e10cSrcweir
239cdf0e10cSrcweir inline Ce_Storage &
Storage()240cdf0e10cSrcweir CeAdmin::Storage()
241cdf0e10cSrcweir {
242cdf0e10cSrcweir return *pStorage;
243cdf0e10cSrcweir }
244cdf0e10cSrcweir
245cdf0e10cSrcweir
246cdf0e10cSrcweir
247cdf0e10cSrcweir } // namespace idl
248cdf0e10cSrcweir } // namespace ary
249cdf0e10cSrcweir #endif
250