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_IA_TYPE_HXX
21 : #define ARY_IDL_IA_TYPE_HXX
22 :
23 :
24 : // USED SERVICES
25 : // BASE CLASSES
26 : #include <ary/idl/ip_type.hxx>
27 : // COMPONENTS
28 : // PARAMETERS
29 : #include "is_type.hxx"
30 :
31 :
32 : namespace ary
33 : {
34 : namespace idl
35 : {
36 :
37 :
38 : class Type_Storage;
39 : class CeAdmin;
40 : class TemplateParamType;
41 :
42 :
43 : class TypeAdmin : public TypePilot
44 : {
45 : public:
46 : // LIFECYCLE
47 : TypeAdmin();
48 :
49 : void Assign_CePilot(
50 : CeAdmin & io_rCes );
51 : virtual ~TypeAdmin();
52 :
53 : // OPERATIONS
54 : TemplateParamType & Store_TemplateParamType(
55 : String i_sName );
56 : // INQUIRY
57 : const Type_Storage &
58 : Storage() const;
59 : // ACCESS
60 : Type_Storage & Storage();
61 :
62 : // INHERITED
63 : // Interface TypePilot:
64 : virtual const Type &
65 : CheckIn_Type(
66 : QualifiedName & i_rFullName,
67 : uintt i_nSequenceCount,
68 : Ce_id i_nModuleOfOccurrence,
69 : const std::vector<Type_id> *
70 : i_templateParameters );
71 : virtual const Type &
72 : Find_Type(
73 : Type_id i_nType ) const;
74 : virtual String Search_LocalNameOf(
75 : Type_id i_nType ) const;
76 : virtual Ce_id Search_CeRelatedTo(
77 : Type_id i_nType ) const;
78 : virtual const ExplicitNameRoom &
79 : Find_XNameRoom(
80 : Type_id i_nType ) const;
81 : virtual bool IsBuiltInOrRelated(
82 : const Type & i_rType ) const;
83 : private:
84 : // Locals
85 : CeAdmin & my_Ces() const;
86 :
87 : void lhf_Put2Storage_and_AssignId(
88 : DYN Type & pass_io_rType );
89 :
90 : ExplicitNameRoom & lhf_CheckIn_XNameRoom(
91 : const QualifiedName &
92 : i_rName,
93 : Ce_id i_nModuleOfOccurrence );
94 : Type_id lhf_CheckIn_TypeName(
95 : const String & i_sLocalName,
96 : ExplicitNameRoom & io_rExplicitNameRoom,
97 : Ce_id i_nModuleOfOccurrence,
98 : const std::vector<Type_id> *
99 : i_templateParameters );
100 : Type_id lhf_CheckIn_Sequence(
101 : Type_id i_nType );
102 : void lhf_CheckIn_BuiltInType(
103 : const char * i_sName,
104 : Rid i_nId );
105 : const ExplicitNameRoom &
106 : find_ExplicitNameRoom(
107 : Type_id i_nType ) const;
108 : ExplicitNameRoom & find_ExplicitNameRoom(
109 : Type_id i_nType );
110 : ExplicitNameRoom & lhf_Get_NameRoomRoot_forModuleofOccurrence(
111 : Ce_id i_nModuleOfOccurrence );
112 :
113 : /// @return Type_id::Null_(), if not found.
114 : Type_id lhf_findBuiltInType(
115 : const String & i_sName );
116 : /// @precond nGlobalNamespace must be valid.
117 : void lhf_Setup_BuildInTypes();
118 :
119 : // DATA
120 : Type_Storage * pStorage; /// @inv pStorage != 0
121 : CeAdmin * pCes; /// @inv pCes != 0
122 :
123 : // Data for saving time:
124 : Type_id nXNameRoom_Root; /** @descr This is different from nXNameRoom_Global, because
125 : the root of explicit name rooms in code without leading "::" is unknown.
126 : */
127 : Type_id nXNameRoom_Global;
128 :
129 : // HACK, because this needs to be saved somehow and is not in storage:
130 : std::map<Ce_id, Type_id>
131 : aMap_ModuleOfOccurrence2NameRoomRoot;
132 : };
133 :
134 :
135 :
136 :
137 :
138 : // IMPLEMENTATION
139 : inline const Type_Storage &
140 46399 : TypeAdmin::Storage() const
141 : {
142 46399 : return *pStorage;
143 : }
144 :
145 : inline Type_Storage &
146 170881 : TypeAdmin::Storage()
147 : {
148 170881 : return *pStorage;
149 : }
150 :
151 : inline void
152 : TypeAdmin::Assign_CePilot( CeAdmin & io_rCes )
153 : {
154 : pCes = &io_rCes;
155 : }
156 :
157 :
158 :
159 :
160 : } // namespace idl
161 : } // namespace ary
162 : #endif
163 :
164 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|