xref: /aoo41x/main/autodoc/inc/ary/cpp/cp_ce.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef ARY_CPP_CP_CE_HXX
29 #define ARY_CPP_CP_CE_HXX
30 
31 
32 // USED SERVICES
33 	// BASE CLASSES
34 	// OTHER
35 #include <ary/cpp/c_types4cpp.hxx>
36 
37 namespace ary
38 {
39     class QualifiedName;
40 
41 namespace cpp
42 {
43     class Class;
44     class CodeEntity;
45     class Enum;
46     class EnumValue;
47     class Function;
48     class InputContext;
49     class Namespace;
50     class OperationSignature;
51     class Typedef;
52     class Variable;
53 
54     struct FunctionFlags;
55     struct S_Parameter;
56     struct VariableFlags;
57 }
58 }
59 
60 
61 
62 
63 
64 namespace ary
65 {
66 namespace cpp
67 {
68 
69 
70 
71 /** Acess to all declared C++ code entites (types, variables, operations)
72     in the repository.
73 */
74 class CePilot
75 {
76   public:
77     // LIFECYCLE
78 	virtual             ~CePilot() {}
79 
80     // OPERATIONS
81 	virtual Namespace &
82 	                    CheckIn_Namespace(
83                             const InputContext &
84                                                 i_context,
85                             const String  &     i_localName ) = 0;
86 	virtual Class &     Store_Class(
87                             const InputContext &
88                                                 i_context,
89 							const String  &     i_localName,
90                             E_ClassKey          i_classKey ) = 0;
91 	virtual Enum &      Store_Enum(
92                             const InputContext &
93                                                 i_context,
94 							const String  &     i_localName ) = 0;
95 	virtual Typedef &   Store_Typedef(
96                             const InputContext &
97                                                 i_context,
98 							const String  &     i_localName,
99                             Type_id             i_referredType ) = 0;
100 
101     /// @return 0, if the function is duplicate.
102 	virtual Function *  Store_Operation(
103                             const InputContext &
104                                                 i_context,
105 							const String  &     i_localName,
106                             Type_id             i_returnType,
107                             const std::vector<S_Parameter> &
108                                                 i_parameters,
109                             E_Virtuality        i_virtuality,
110                             E_ConVol            i_conVol,
111                             FunctionFlags       i_flags,
112                             bool                i_throwExists,
113                             const std::vector<Tid> &
114                                                 i_exceptions ) = 0;
115 	virtual Variable &  Store_Variable(
116                             const InputContext &
117                                                 i_context,
118 							const String  &     i_localName,
119                             Type_id             i_type,
120                             VariableFlags       i_flags,
121                             const String  &     i_arraySize,
122                             const String  &     i_initValue ) = 0;
123 	virtual EnumValue & Store_EnumValue(
124                             const InputContext &
125                                                 i_context,
126 							const String  &     i_localName,
127                             const String  &     i_initValue ) = 0;
128     // INQUIRY
129 	virtual const Namespace &
130 	                    GlobalNamespace() const = 0;
131 	virtual const CodeEntity &
132 	                    Find_Ce(
133 							Ce_id				i_id ) const = 0;
134 	virtual const CodeEntity *
135 	                    Search_Ce(
136 							Ce_id		        i_id ) const = 0;
137 
138     /// It's assumed that i_rSearchedName is an absolute name.
139     virtual const CodeEntity *
140                         Search_CeAbsolute(
141                             const CodeEntity &  i_curScope,
142                             const QualifiedName &
143                                                 i_absoluteName ) const = 0;
144     virtual const CodeEntity *
145                         Search_CeLocal(
146                             const String  &     i_relativeName,
147                             bool                i_isFunction,
148                             const Namespace &   i_curNamespace,
149                             const Class *       i_curClass ) const = 0;
150     virtual void        Get_QualifiedName(
151                             StreamStr &         o_result,
152                             const String  &     i_localName,
153                             Ce_id               i_owner,
154                             const char *        i_delimiter = "::" ) const = 0;
155     virtual void        Get_SignatureText(
156                             StreamStr &         o_rOut,
157                             const OperationSignature &
158                                                 i_signature,
159                             const StringVector *
160                                                 i_sParameterNames = 0 ) const = 0;
161     virtual CesResultList
162                         Search_TypeName(
163                             const String  &     i_sName ) const = 0;
164     // ACCESS
165    	virtual Namespace & GlobalNamespace() = 0;
166 };
167 
168 
169 
170 
171 }   // namespace cpp
172 }   // namespace ary
173 #endif
174