Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef ARY_IDL_I2S_CALCULATOR_HXX
21 : #define ARY_IDL_I2S_CALCULATOR_HXX
22 :
23 :
24 : // USED SERVICES
25 : // BASE CLASSES
26 : #include <cosv/tpl/processor.hxx>
27 : // PARAMETERS
28 : #include <ary/idl/i_types4idl.hxx>
29 :
30 :
31 : namespace ary
32 : {
33 : namespace idl
34 : {
35 : class CeAdmin;
36 : class Ce_Storage;
37 : class TypeAdmin;
38 : class Type_Storage;
39 : class ExplicitType;
40 : class Function;
41 : class Interface;
42 : class Property;
43 : class Typedef;
44 : class Service;
45 : class Singleton;
46 : class SglIfcService;
47 : class SglIfcSingleton;
48 : class Struct;
49 : class StructElement;
50 : class Exception;
51 : class Ce_2s;
52 : }
53 : }
54 :
55 :
56 :
57 :
58 :
59 :
60 : namespace ary
61 : {
62 : namespace idl
63 : {
64 :
65 :
66 : enum E_2s_of_Service
67 : {
68 : service_2s_IncludingServices,
69 : service_2s_InstantiatingSingletons
70 : };
71 :
72 : enum E_2s_of_Interface
73 : {
74 : interface_2s_Derivations,
75 : interface_2s_ExportingServices,
76 : interface_2s_ExportingSingletons,
77 : interface_2s_SynonymTypedefs,
78 : // interface_2s_UsingTypedefs,
79 : interface_2s_AsReturns,
80 : // interface_2s_AsIndirectReturns,
81 : interface_2s_AsParameters,
82 : // interface_2s_AsIndirectParameters,
83 : interface_2s_AsDataTypes
84 : };
85 :
86 : enum E_2s_of_Struct
87 : {
88 : struct_2s_Derivations,
89 : struct_2s_SynonymTypedefs,
90 : // struct_2s_UsingTypedefs,
91 : struct_2s_AsReturns,
92 : // struct_2s_AsIndirectReturns,
93 : struct_2s_AsParameters,
94 : // struct_2s_AsIndirectParameters,
95 : struct_2s_AsDataTypes
96 : };
97 :
98 : enum E_2s_of_Enum
99 : {
100 : enum_2s_SynonymTypedefs,
101 : // enum_2s_UsingTypedefs,
102 : enum_2s_AsReturns,
103 : // enum_2s_AsIndirectReturns,
104 : enum_2s_AsParameters,
105 : // enum_2s_AsIndirectParameters,
106 : enum_2s_AsDataTypes
107 : };
108 :
109 : enum E_2s_of_Typedef
110 : {
111 : typedef_2s_SynonymTypedefs,
112 : // typedef_2s_UsingTypedefs,
113 : typedef_2s_AsReturns,
114 : // typedef_2s_AsIndirectReturns,
115 : typedef_2s_AsParameters,
116 : // typedef_2s_AsIndirectParameters,
117 : typedef_2s_AsDataTypes
118 : };
119 :
120 : enum E_2s_of_Exceptions
121 : {
122 : exception_2s_Derivations,
123 : exception_2s_RaisingFunctions
124 : };
125 :
126 :
127 :
128 2 : class SPInst_asHost : public csv::ProcessorIfc,
129 : public csv::ConstProcessor<Service>,
130 : public csv::ConstProcessor<Interface>,
131 : public csv::ConstProcessor<Struct>,
132 : public csv::ConstProcessor<Exception>,
133 : public csv::ConstProcessor<Typedef>,
134 : public csv::ConstProcessor<Singleton>,
135 : public csv::ConstProcessor<Function>,
136 : public csv::ConstProcessor<StructElement>,
137 : public csv::ConstProcessor<Property>,
138 : public csv::ConstProcessor<SglIfcService>,
139 : public csv::ConstProcessor<SglIfcSingleton>
140 : {
141 : };
142 :
143 :
144 :
145 :
146 : /** This class scans the parsed data and produces several
147 : secondary data like cross references and alphabetical indices.
148 :
149 : In this declaration "Secondaries" or "2s" mean those secondary data.
150 :
151 : @see Ce_2s
152 : */
153 : class SecondariesCalculator : public SPInst_asHost
154 : {
155 : public:
156 : // LIFECYCLE
157 : SecondariesCalculator(
158 : CeAdmin & i_ces,
159 : TypeAdmin & i_types );
160 : virtual ~SecondariesCalculator();
161 :
162 : // OPERATIONS
163 : void CheckAllInterfaceBases();
164 : void Connect_Types2Ces();
165 : void Gather_CrossReferences();
166 : void Make_Links2DeveloperManual(
167 : const String & i_devman_reffilepath );
168 :
169 : private:
170 : // Interface CeHost These are the points to gather cross
171 : // references:
172 : virtual void do_Process(
173 : const Service & i_rData );
174 : virtual void do_Process(
175 : const Interface & i_rData );
176 : virtual void do_Process(
177 : const Struct & i_rData );
178 : virtual void do_Process(
179 : const Exception & i_rData );
180 : virtual void do_Process(
181 : const Typedef & i_rData );
182 : virtual void do_Process(
183 : const Singleton & i_rData );
184 : virtual void do_Process(
185 : const Function & i_rData );
186 : virtual void do_Process(
187 : const StructElement &
188 : i_rData );
189 : virtual void do_Process(
190 : const Property & i_rData );
191 : virtual void do_Process(
192 : const SglIfcService &
193 : i_rData );
194 : virtual void do_Process(
195 : const SglIfcSingleton &
196 : i_rData );
197 :
198 : // Locals
199 : const Ce_Storage & my_CeStorage() const;
200 : const Type_Storage &
201 : my_TypeStorage() const;
202 : Ce_Storage & my_CeStorage();
203 : Type_Storage & my_TypeStorage();
204 :
205 : template <class DEST>
206 : DEST * SearchCe4Type(
207 : Type_id i_type );
208 : Ce_id lhf_Search_CeForType(
209 : const ExplicitType &
210 : i_rType ) const;
211 : Ce_id lhf_Search_CeFromTypeId(
212 : Type_id i_nType ) const;
213 : Service * lhf_SearchService(
214 : Type_id i_nServ );
215 : Interface * lhf_SearchInterface(
216 : Type_id i_nIfc );
217 : Struct * lhf_SearchStruct(
218 : Type_id i_nIfc );
219 : Exception * lhf_SearchException(
220 : Type_id i_nIfc );
221 : void assign_CurLink(
222 : char * i_text,
223 : const String & i_link,
224 : const String & i_linkUI,
225 : bool i_isDescr, /// @descr true: description, false: reference.
226 : int i_lineCount );
227 : void gather_Synonyms();
228 : void recursive_AssignAsSynonym(
229 : Ce_id i_synonymousTypedefsId,
230 : const Typedef & i_TypedefToCheck );
231 : void recursive_AssignIncludingService(
232 : Ce_id i_includingServicesId,
233 : const Service & i_ServiceToCheckItsIncludes );
234 : void assign_AsDerivedInterface(
235 : const Interface & i_rDerived );
236 : void assign_AsDerivedStruct(
237 : const Struct & i_rDerived );
238 : void assign_AsDerivedException(
239 : const Exception & i_rDerived );
240 : void assignImplementation_toAServicesInterfaces(
241 : Ce_id i_nImpl,
242 : Ce_id i_nService,
243 : E_2s_of_Interface i_eList );
244 : void recursive_AssignImplementation_toExportedInterface(
245 : Ce_id i_nService,
246 : Type_id i_nExportedInterface,
247 : E_2s_of_Interface i_eList );
248 : void recursive_AssignFunction_toCeAsReturn(
249 : Ce_id i_nFunction,
250 : Type_id i_nReturnType );
251 : void recursive_AssignFunction_toCeAsParameter(
252 : Ce_id i_nFunction,
253 : Type_id i_nParameterType );
254 :
255 : /** @param i_nDataElement
256 : May be the ID of an struct element as well as an exception element
257 : or a property.
258 : */
259 : void recursive_AssignStructElement_toCeAsDataType(
260 : Ce_id i_nDataElement,
261 : Type_id i_nDataType );
262 : void insert_into2sList(
263 : CodeEntity & o_out,
264 : int i_listIndex,
265 : Ce_id i_nCe );
266 : void insert_into2sUnique(
267 : CodeEntity & o_out,
268 : int i_listIndex,
269 : Ce_id i_nCe );
270 : /// Sorts secondary production lists alphabetical.
271 : void sort_All2s();
272 :
273 : void Read_Links2DevManual(
274 : csv::bstream & i_file );
275 :
276 : // DATA
277 : CeAdmin * pCes;
278 : TypeAdmin * pTypes;
279 : };
280 :
281 :
282 :
283 :
284 : } // namespace idl
285 : } // namespace ary
286 : #endif
287 :
288 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|