xref: /AOO41X/main/autodoc/source/ary/cpp/ca_ce.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef ARY_CPP_CA_CE_HXX
29*cdf0e10cSrcweir #define ARY_CPP_CA_CE_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir // USED SERVICES
32*cdf0e10cSrcweir 	// BASE CLASSES
33*cdf0e10cSrcweir #include <ary/cpp/cp_ce.hxx>
34*cdf0e10cSrcweir 	// OTHER
35*cdf0e10cSrcweir #include "cs_ce.hxx"
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir 
38*cdf0e10cSrcweir namespace ary
39*cdf0e10cSrcweir {
40*cdf0e10cSrcweir namespace cpp
41*cdf0e10cSrcweir {
42*cdf0e10cSrcweir     class Ce_Storage;
43*cdf0e10cSrcweir     class RepositoryPartition;
44*cdf0e10cSrcweir }
45*cdf0e10cSrcweir }
46*cdf0e10cSrcweir 
47*cdf0e10cSrcweir 
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir 
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir namespace ary
52*cdf0e10cSrcweir {
53*cdf0e10cSrcweir namespace cpp
54*cdf0e10cSrcweir {
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir 
57*cdf0e10cSrcweir 
58*cdf0e10cSrcweir /** Administrates all C++ code entities (types, operations, variables).
59*cdf0e10cSrcweir */
60*cdf0e10cSrcweir class CeAdmin : public CePilot
61*cdf0e10cSrcweir {
62*cdf0e10cSrcweir   public:
63*cdf0e10cSrcweir 	// LIFECYCLE
64*cdf0e10cSrcweir 						CeAdmin(
65*cdf0e10cSrcweir 						    RepositoryPartition &
66*cdf0e10cSrcweir 						                        io_myReposyPartition );
67*cdf0e10cSrcweir     void                Set_Related(
68*cdf0e10cSrcweir                             const TypePilot &   i_types );
69*cdf0e10cSrcweir 	virtual 		    ~CeAdmin();
70*cdf0e10cSrcweir 
71*cdf0e10cSrcweir     // INQUIRY
72*cdf0e10cSrcweir     const Ce_Storage &  Storage() const;
73*cdf0e10cSrcweir 
74*cdf0e10cSrcweir     // ACCESS
75*cdf0e10cSrcweir     Ce_Storage &        Storage();
76*cdf0e10cSrcweir 
77*cdf0e10cSrcweir     // INHERITED
78*cdf0e10cSrcweir     // Interface CePilot:
79*cdf0e10cSrcweir 	virtual Namespace & CheckIn_Namespace(
80*cdf0e10cSrcweir                             const InputContext &
81*cdf0e10cSrcweir                                                 i_context,
82*cdf0e10cSrcweir                             const String  &     i_localName );
83*cdf0e10cSrcweir 	virtual Class &     Store_Class(
84*cdf0e10cSrcweir                             const InputContext &
85*cdf0e10cSrcweir                                                 i_context,
86*cdf0e10cSrcweir 							const String  &     i_localName,
87*cdf0e10cSrcweir                             E_ClassKey          i_classKey );
88*cdf0e10cSrcweir 	virtual Enum &      Store_Enum(
89*cdf0e10cSrcweir                             const InputContext &
90*cdf0e10cSrcweir                                                 i_context,
91*cdf0e10cSrcweir 							const String  &     i_localName );
92*cdf0e10cSrcweir 	virtual Typedef &   Store_Typedef(
93*cdf0e10cSrcweir                             const InputContext &
94*cdf0e10cSrcweir                                                 i_context,
95*cdf0e10cSrcweir 							const String  &     i_localName,
96*cdf0e10cSrcweir                             Type_id             i_referredType );
97*cdf0e10cSrcweir 	virtual Function *  Store_Operation(
98*cdf0e10cSrcweir                             const InputContext &
99*cdf0e10cSrcweir                                                 i_context,
100*cdf0e10cSrcweir 							const String  &     i_localName,
101*cdf0e10cSrcweir                             Type_id             i_returnType,
102*cdf0e10cSrcweir                             const std::vector<S_Parameter> &
103*cdf0e10cSrcweir                                                 i_parameters,
104*cdf0e10cSrcweir                             E_Virtuality        i_virtuality,
105*cdf0e10cSrcweir                             E_ConVol            i_conVol,
106*cdf0e10cSrcweir                             FunctionFlags       i_flags,
107*cdf0e10cSrcweir                             bool                i_throwExists,
108*cdf0e10cSrcweir                             const std::vector<Type_id> &
109*cdf0e10cSrcweir                                                 i_exceptions );
110*cdf0e10cSrcweir 	virtual Variable &  Store_Variable(
111*cdf0e10cSrcweir                             const InputContext &
112*cdf0e10cSrcweir                                                 i_context,
113*cdf0e10cSrcweir 							const String  &     i_localName,
114*cdf0e10cSrcweir                             Type_id             i_type,
115*cdf0e10cSrcweir                             VariableFlags       i_flags,
116*cdf0e10cSrcweir                             const String  &     i_arraySize,
117*cdf0e10cSrcweir                             const String  &     i_initValue );
118*cdf0e10cSrcweir 	virtual EnumValue & Store_EnumValue(
119*cdf0e10cSrcweir                             const InputContext &
120*cdf0e10cSrcweir                                                 i_context,
121*cdf0e10cSrcweir 							const String  &     i_localName,
122*cdf0e10cSrcweir                             const String  &     i_initValue );
123*cdf0e10cSrcweir 	virtual const Namespace &
124*cdf0e10cSrcweir 	                    GlobalNamespace() const;
125*cdf0e10cSrcweir 	virtual const CodeEntity &
126*cdf0e10cSrcweir 	                    Find_Ce(
127*cdf0e10cSrcweir 							Ce_id				i_id ) const;
128*cdf0e10cSrcweir 	virtual const CodeEntity *
129*cdf0e10cSrcweir 	                    Search_Ce(
130*cdf0e10cSrcweir 							Ce_id		        i_id ) const;
131*cdf0e10cSrcweir     virtual const CodeEntity *
132*cdf0e10cSrcweir                         Search_CeAbsolute(
133*cdf0e10cSrcweir                             const CodeEntity &  i_curScope,
134*cdf0e10cSrcweir                             const QualifiedName &
135*cdf0e10cSrcweir                                                 i_absoluteName ) const;
136*cdf0e10cSrcweir     virtual const CodeEntity *
137*cdf0e10cSrcweir                         Search_CeLocal(
138*cdf0e10cSrcweir                             const String  &     i_relativeName,
139*cdf0e10cSrcweir                             bool                i_isFunction,
140*cdf0e10cSrcweir                             const Namespace &   i_curNamespace,
141*cdf0e10cSrcweir                             const Class *       i_curClass ) const;
142*cdf0e10cSrcweir     virtual void        Get_QualifiedName(
143*cdf0e10cSrcweir                             StreamStr &         o_result,
144*cdf0e10cSrcweir                             const String  &     i_localName,
145*cdf0e10cSrcweir                             Ce_id               i_owner,
146*cdf0e10cSrcweir                             const char *        i_delimiter = "::" ) const;
147*cdf0e10cSrcweir     virtual void        Get_SignatureText(
148*cdf0e10cSrcweir                             StreamStr &         o_rOut,
149*cdf0e10cSrcweir                             const OperationSignature &
150*cdf0e10cSrcweir                                                 i_signature,
151*cdf0e10cSrcweir                             const StringVector *
152*cdf0e10cSrcweir                                                 i_sParameterNames = 0 ) const;
153*cdf0e10cSrcweir     virtual CesResultList
154*cdf0e10cSrcweir                         Search_TypeName(
155*cdf0e10cSrcweir                             const String  &     i_sName ) const;
156*cdf0e10cSrcweir    	virtual Namespace & GlobalNamespace();
157*cdf0e10cSrcweir 
158*cdf0e10cSrcweir   private:
159*cdf0e10cSrcweir     // Locals
160*cdf0e10cSrcweir     /// @return true, if function is duplicate.
161*cdf0e10cSrcweir     enum E_DuplicateFunction
162*cdf0e10cSrcweir     {
163*cdf0e10cSrcweir         df_no,
164*cdf0e10cSrcweir         df_replace,
165*cdf0e10cSrcweir         df_discard_new
166*cdf0e10cSrcweir     };
167*cdf0e10cSrcweir 
168*cdf0e10cSrcweir     /** @param o_existentFunction
169*cdf0e10cSrcweir             The id of the already existing function, else unset.
170*cdf0e10cSrcweir     */
171*cdf0e10cSrcweir     E_DuplicateFunction lhf_CheckAndHandle_DuplicateOperation(
172*cdf0e10cSrcweir                             Ce_id &             o_existentFunction,
173*cdf0e10cSrcweir                             const InputContext &
174*cdf0e10cSrcweir                                                 i_context,
175*cdf0e10cSrcweir                             const Function &    i_newFunction );
176*cdf0e10cSrcweir     Namespace &         Create_Namespace(
177*cdf0e10cSrcweir                             Namespace &         o_parent,
178*cdf0e10cSrcweir                             const String  &     i_localName );
179*cdf0e10cSrcweir     Ce_id               Search_MatchingInstance(
180*cdf0e10cSrcweir                             CesResultList       i_list,
181*cdf0e10cSrcweir                             Ce_id               i_owner ) const;
182*cdf0e10cSrcweir     const TypePilot  &  Types() const;
183*cdf0e10cSrcweir 
184*cdf0e10cSrcweir     // DATA
185*cdf0e10cSrcweir     Ce_Storage          aStorage;
186*cdf0e10cSrcweir     const TypePilot *   pTypes;
187*cdf0e10cSrcweir     RepositoryPartition *
188*cdf0e10cSrcweir                         pCppRepositoryPartition;
189*cdf0e10cSrcweir };
190*cdf0e10cSrcweir 
191*cdf0e10cSrcweir 
192*cdf0e10cSrcweir 
193*cdf0e10cSrcweir 
194*cdf0e10cSrcweir // IMPLEMENTATION
195*cdf0e10cSrcweir inline const Ce_Storage &
196*cdf0e10cSrcweir CeAdmin::Storage() const
197*cdf0e10cSrcweir {
198*cdf0e10cSrcweir     return aStorage;
199*cdf0e10cSrcweir }
200*cdf0e10cSrcweir 
201*cdf0e10cSrcweir inline Ce_Storage &
202*cdf0e10cSrcweir CeAdmin::Storage()
203*cdf0e10cSrcweir {
204*cdf0e10cSrcweir     return aStorage;
205*cdf0e10cSrcweir }
206*cdf0e10cSrcweir 
207*cdf0e10cSrcweir 
208*cdf0e10cSrcweir 
209*cdf0e10cSrcweir 
210*cdf0e10cSrcweir 
211*cdf0e10cSrcweir }   // namespace cpp
212*cdf0e10cSrcweir }   // namespace ary
213*cdf0e10cSrcweir #endif
214