xref: /aoo42x/main/autodoc/source/ary/cpp/cs_ce.cxx (revision d291ea28)
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 #include <precomp.h>
23 #include "cs_ce.hxx"
24 
25 // NOT FULLY DEFINED SERVICES
26 #include <ary/cpp/c_namesp.hxx>
27 
28 
29 
30 namespace
31 {
32 const uintt
33     C_nReservedElements = ::ary::cpp::predefined::ce_MAX;    // Skipping "0" and the GlobalNamespace
34 }
35 
36 
37 
38 
39 namespace ary
40 {
41 namespace cpp
42 {
43 
44 Ce_Storage *    Ce_Storage::pInstance_ = 0;
45 
46 
47 
Ce_Storage()48 Ce_Storage::Ce_Storage()
49     :   stg::Storage<CodeEntity>(C_nReservedElements),
50         aTypes(),
51         aOperations(),
52         aData()
53 
54 {
55     Set_Reserved( predefined::ce_GlobalNamespace,
56                   *new Namespace );
57 
58     csv_assert(pInstance_ == 0);
59     pInstance_ = this;
60 }
61 
~Ce_Storage()62 Ce_Storage::~Ce_Storage()
63 {
64     csv_assert(pInstance_ != 0);
65     pInstance_ = 0;
66 }
67 
68 Ce_id
Store_Type(DYN CodeEntity & pass_ce)69 Ce_Storage::Store_Type(DYN CodeEntity & pass_ce)
70 {
71     Ce_id
72         ret = Store_Entity(pass_ce);
73     aTypes.Add(ret);
74     return ret;
75 }
76 
77 Ce_id
Store_Operation(DYN CodeEntity & pass_ce)78 Ce_Storage::Store_Operation(DYN CodeEntity & pass_ce)
79 {
80     Ce_id
81         ret = Store_Entity(pass_ce);
82     aOperations.Add(ret);
83     return ret;
84 }
85 
86 Ce_id
Store_Datum(DYN CodeEntity & pass_ce)87 Ce_Storage::Store_Datum(DYN CodeEntity & pass_ce)
88 {
89     Ce_id
90         ret = Store_Entity(pass_ce);
91     aData.Add(ret);
92     return ret;
93 }
94 
95 
96 
97 }   // namespace cpp
98 }   // namespace ary
99