xref: /aoo41x/main/autodoc/source/ary/cpp/cs_ce.hxx (revision 1c78a5d6)
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_CS_CE_HXX
25 #define ARY_CPP_CS_CE_HXX
26 
27 
28 
29 // USED SERVICES
30     // BASE CLASSES
31 #include <store/s_storage.hxx>
32     // OTHER
33 #include <ary/cpp/c_ce.hxx>
34 #include <ary/cpp/c_traits.hxx>
35 #include <sortedids.hxx>
36 
37 
38 
39 namespace ary
40 {
41 namespace cpp
42 {
43 
44 
45 /** The data base for all ->ary::cpp::CodeEntity objects.
46 */
47 class Ce_Storage : public ::ary::stg::Storage<CodeEntity>
48 {
49   public:
50     typedef SortedIds<Ce_Compare>       Index;
51 
52                         Ce_Storage();
53     virtual             ~Ce_Storage();
54 
55     Ce_id               Store_Type(
56                             DYN CodeEntity &    pass_ce );
57     Ce_id               Store_Operation(
58                             DYN CodeEntity &    pass_ce );
59     Ce_id               Store_Datum(
60                             DYN CodeEntity &    pass_ce );
61 
TypeIndex() const62     const Index &       TypeIndex() const           { return aTypes; }
OperationIndex() const63     const Index &       OperationIndex() const      { return aOperations; }
DataIndex() const64     const Index &       DataIndex() const           { return aData; }
65 
TypeIndex()66     Index &             TypeIndex()                 { return aTypes; }
OperationIndex()67     Index &             OperationIndex()            { return aOperations; }
DataIndex()68     Index &             DataIndex()                 { return aData; }
69 
Instance_()70     static Ce_Storage & Instance_()                 { csv_assert(pInstance_ != 0);
71                                                       return *pInstance_; }
72   private:
73     // DATA
74     Index               aTypes;
75     Index               aOperations;
76     Index               aData;
77 
78     static Ce_Storage * pInstance_;
79 };
80 
81 
82 
83 
84 namespace predefined
85 {
86 
87 enum E_CodeEntity
88 {
89     ce_GlobalNamespace = 1,
90     ce_MAX
91 };
92 
93 }   // namespace predefined
94 
95 
96 
97 
98 
99 }   // namespace cpp
100 }   // namespace ary
101 #endif
102