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_CA_TYPE_HXX
25 #define ARY_CPP_CA_TYPE_HXX
26
27 // USED SERVICES
28 // BASE CLASSES
29 #include <ary/cpp/cp_type.hxx>
30 // OTHER
31 #include "cs_type.hxx"
32
33
34
35 namespace ary
36 {
37 namespace cpp
38 {
39 class RepositoryPartition;
40 }
41 }
42
43
44
45
46
47 namespace ary
48 {
49 namespace cpp
50 {
51
52
53
54 /** Administrates all C++ types as uses in user declarations
55 as return-, parameter- or variable-types.
56 */
57 class TypeAdmin : public TypePilot
58 {
59 public:
60 // LIFECYCLE
61 TypeAdmin(
62 RepositoryPartition &
63 io_myReposyPartition );
64 virtual ~TypeAdmin();
65
66 // INQUIRY
67 /// @return A list of all stored types that are not C++ or STL builtin types.
68 const Type_Storage &
69 Storage() const;
70
71 // ACCESS
72 Type_Storage & Storage();
73
74 // INHERITED
75 // Interface TypePilot:
76 virtual const Type &
77 CheckIn_UsedType(
78 const InputContext &
79 i_context,
80 DYN UsedType & pass_type );
81 virtual const Type &
82 Find_Type(
83 Type_id i_type ) const;
84 virtual bool Get_TypeText(
85 StreamStr & o_result,
86 Type_id i_type ) const;
87 virtual bool Get_TypeText(
88 StreamStr & o_preName, /// ::ary::cpp::
89 StreamStr & o_name, /// MyClass
90 StreamStr & o_postName, /// <TplArgument> * const &
91 Type_id i_type ) const;
92 virtual Type_id Tid_Ellipse() const;
93
94 private:
95 // DATA
96 Type_Storage aStorage;
97 RepositoryPartition *
98 pCppRepositoryPartition;
99 };
100
101
102
103
104 // IMPLEMENTATION
105 inline const Type_Storage &
Storage() const106 TypeAdmin::Storage() const
107 {
108 return aStorage;
109 }
110
111 inline Type_Storage &
Storage()112 TypeAdmin::Storage()
113 {
114 return aStorage;
115 }
116
117
118
119
120
121 } // namespace cpp
122 } // namespace ary
123 #endif
124