xref: /aoo4110/main/autodoc/inc/ary/cpp/cp_ce.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef ARY_CPP_CP_CE_HXX
25 #define ARY_CPP_CP_CE_HXX
26 
27 
28 // USED SERVICES
29 	// BASE CLASSES
30 	// OTHER
31 #include <ary/cpp/c_types4cpp.hxx>
32 
33 namespace ary
34 {
35     class QualifiedName;
36 
37 namespace cpp
38 {
39     class Class;
40     class CodeEntity;
41     class Enum;
42     class EnumValue;
43     class Function;
44     class InputContext;
45     class Namespace;
46     class OperationSignature;
47     class Typedef;
48     class Variable;
49 
50     struct FunctionFlags;
51     struct S_Parameter;
52     struct VariableFlags;
53 }
54 }
55 
56 
57 
58 
59 
60 namespace ary
61 {
62 namespace cpp
63 {
64 
65 
66 
67 /** Acess to all declared C++ code entites (types, variables, operations)
68     in the repository.
69 */
70 class CePilot
71 {
72   public:
73     // LIFECYCLE
~CePilot()74 	virtual             ~CePilot() {}
75 
76     // OPERATIONS
77 	virtual Namespace &
78 	                    CheckIn_Namespace(
79                             const InputContext &
80                                                 i_context,
81                             const String  &     i_localName ) = 0;
82 	virtual Class &     Store_Class(
83                             const InputContext &
84                                                 i_context,
85 							const String  &     i_localName,
86                             E_ClassKey          i_classKey ) = 0;
87 	virtual Enum &      Store_Enum(
88                             const InputContext &
89                                                 i_context,
90 							const String  &     i_localName ) = 0;
91 	virtual Typedef &   Store_Typedef(
92                             const InputContext &
93                                                 i_context,
94 							const String  &     i_localName,
95                             Type_id             i_referredType ) = 0;
96 
97     /// @return 0, if the function is duplicate.
98 	virtual Function *  Store_Operation(
99                             const InputContext &
100                                                 i_context,
101 							const String  &     i_localName,
102                             Type_id             i_returnType,
103                             const std::vector<S_Parameter> &
104                                                 i_parameters,
105                             E_Virtuality        i_virtuality,
106                             E_ConVol            i_conVol,
107                             FunctionFlags       i_flags,
108                             bool                i_throwExists,
109                             const std::vector<Tid> &
110                                                 i_exceptions ) = 0;
111 	virtual Variable &  Store_Variable(
112                             const InputContext &
113                                                 i_context,
114 							const String  &     i_localName,
115                             Type_id             i_type,
116                             VariableFlags       i_flags,
117                             const String  &     i_arraySize,
118                             const String  &     i_initValue ) = 0;
119 	virtual EnumValue & Store_EnumValue(
120                             const InputContext &
121                                                 i_context,
122 							const String  &     i_localName,
123                             const String  &     i_initValue ) = 0;
124     // INQUIRY
125 	virtual const Namespace &
126 	                    GlobalNamespace() const = 0;
127 	virtual const CodeEntity &
128 	                    Find_Ce(
129 							Ce_id				i_id ) const = 0;
130 	virtual const CodeEntity *
131 	                    Search_Ce(
132 							Ce_id		        i_id ) const = 0;
133 
134     /// It's assumed that i_rSearchedName is an absolute name.
135     virtual const CodeEntity *
136                         Search_CeAbsolute(
137                             const CodeEntity &  i_curScope,
138                             const QualifiedName &
139                                                 i_absoluteName ) const = 0;
140     virtual const CodeEntity *
141                         Search_CeLocal(
142                             const String  &     i_relativeName,
143                             bool                i_isFunction,
144                             const Namespace &   i_curNamespace,
145                             const Class *       i_curClass ) const = 0;
146     virtual void        Get_QualifiedName(
147                             StreamStr &         o_result,
148                             const String  &     i_localName,
149                             Ce_id               i_owner,
150                             const char *        i_delimiter = "::" ) const = 0;
151     virtual void        Get_SignatureText(
152                             StreamStr &         o_rOut,
153                             const OperationSignature &
154                                                 i_signature,
155                             const StringVector *
156                                                 i_sParameterNames = 0 ) const = 0;
157     virtual CesResultList
158                         Search_TypeName(
159                             const String  &     i_sName ) const = 0;
160     // ACCESS
161    	virtual Namespace & GlobalNamespace() = 0;
162 };
163 
164 
165 
166 
167 }   // namespace cpp
168 }   // namespace ary
169 #endif
170