xref: /aoo41x/main/autodoc/source/ary/cpp/c_enum.cxx (revision d291ea28)
1*d291ea28SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*d291ea28SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*d291ea28SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*d291ea28SAndrew Rist  * distributed with this work for additional information
6*d291ea28SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*d291ea28SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*d291ea28SAndrew Rist  * "License"); you may not use this file except in compliance
9*d291ea28SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*d291ea28SAndrew Rist  *
11*d291ea28SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*d291ea28SAndrew Rist  *
13*d291ea28SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*d291ea28SAndrew Rist  * software distributed under the License is distributed on an
15*d291ea28SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d291ea28SAndrew Rist  * KIND, either express or implied.  See the License for the
17*d291ea28SAndrew Rist  * specific language governing permissions and limitations
18*d291ea28SAndrew Rist  * under the License.
19*d291ea28SAndrew Rist  *
20*d291ea28SAndrew Rist  *************************************************************/
21cdf0e10cSrcweir 
22cdf0e10cSrcweir #include <precomp.h>
23cdf0e10cSrcweir #include <ary/cpp/c_enum.hxx>
24cdf0e10cSrcweir 
25cdf0e10cSrcweir 
26cdf0e10cSrcweir // NOT FULLY DECLARED SERVICES
27cdf0e10cSrcweir #include <slots.hxx>
28cdf0e10cSrcweir #include "c_slots.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir 
31cdf0e10cSrcweir 
32cdf0e10cSrcweir 
33cdf0e10cSrcweir namespace ary
34cdf0e10cSrcweir {
35cdf0e10cSrcweir namespace cpp
36cdf0e10cSrcweir {
37cdf0e10cSrcweir 
Enum(const String & i_sLocalName,Ce_id i_nOwner,E_Protection i_eProtection,Lid i_nFile)38cdf0e10cSrcweir Enum::Enum( const String  &     i_sLocalName,
39cdf0e10cSrcweir             Ce_id               i_nOwner,
40cdf0e10cSrcweir             E_Protection        i_eProtection,
41cdf0e10cSrcweir             Lid                 i_nFile )
42cdf0e10cSrcweir     :   aEssentials( i_sLocalName,
43cdf0e10cSrcweir                      i_nOwner,
44cdf0e10cSrcweir                      i_nFile ),
45cdf0e10cSrcweir         aValues(),
46cdf0e10cSrcweir         eProtection(i_eProtection)
47cdf0e10cSrcweir {
48cdf0e10cSrcweir }
49cdf0e10cSrcweir 
~Enum()50cdf0e10cSrcweir Enum::~Enum()
51cdf0e10cSrcweir {
52cdf0e10cSrcweir }
53cdf0e10cSrcweir 
54cdf0e10cSrcweir void
Add_Value(Ce_id i_nId)55cdf0e10cSrcweir Enum::Add_Value( Ce_id i_nId )
56cdf0e10cSrcweir {
57cdf0e10cSrcweir 	aValues.Add( i_nId );
58cdf0e10cSrcweir }
59cdf0e10cSrcweir 
60cdf0e10cSrcweir const String  &
inq_LocalName() const61cdf0e10cSrcweir Enum::inq_LocalName() const
62cdf0e10cSrcweir {
63cdf0e10cSrcweir 	return aEssentials.LocalName();
64cdf0e10cSrcweir }
65cdf0e10cSrcweir 
66cdf0e10cSrcweir Cid
inq_Owner() const67cdf0e10cSrcweir Enum::inq_Owner() const
68cdf0e10cSrcweir {
69cdf0e10cSrcweir 	return aEssentials.Owner();
70cdf0e10cSrcweir }
71cdf0e10cSrcweir 
72cdf0e10cSrcweir Lid
inq_Location() const73cdf0e10cSrcweir Enum::inq_Location() const
74cdf0e10cSrcweir {
75cdf0e10cSrcweir 	return aEssentials.Location();
76cdf0e10cSrcweir }
77cdf0e10cSrcweir 
78cdf0e10cSrcweir void
do_Accept(csv::ProcessorIfc & io_processor) const79cdf0e10cSrcweir Enum::do_Accept(csv::ProcessorIfc & io_processor) const
80cdf0e10cSrcweir {
81cdf0e10cSrcweir     csv::CheckedCall(io_processor,*this);
82cdf0e10cSrcweir }
83cdf0e10cSrcweir 
84cdf0e10cSrcweir ClassId
get_AryClass() const85cdf0e10cSrcweir Enum::get_AryClass() const
86cdf0e10cSrcweir {
87cdf0e10cSrcweir 	return class_id;
88cdf0e10cSrcweir }
89cdf0e10cSrcweir 
90cdf0e10cSrcweir Gid
inq_Id_Group() const91cdf0e10cSrcweir Enum::inq_Id_Group() const
92cdf0e10cSrcweir {
93cdf0e10cSrcweir     return static_cast<Gid>(Id());
94cdf0e10cSrcweir }
95cdf0e10cSrcweir 
96cdf0e10cSrcweir const ary::cpp::CppEntity &
inq_RE_Group() const97cdf0e10cSrcweir Enum::inq_RE_Group() const
98cdf0e10cSrcweir {
99cdf0e10cSrcweir     return *this;
100cdf0e10cSrcweir }
101cdf0e10cSrcweir 
102cdf0e10cSrcweir const group::SlotList &
inq_Slots() const103cdf0e10cSrcweir Enum::inq_Slots() const
104cdf0e10cSrcweir {
105cdf0e10cSrcweir     static const SlotAccessId aProjectSlotData[]
106cdf0e10cSrcweir             = { SLOT_Values };
107cdf0e10cSrcweir     static const std::vector< SlotAccessId >
108cdf0e10cSrcweir             aSlots( &aProjectSlotData[0],
109cdf0e10cSrcweir                       &aProjectSlotData[0]
110cdf0e10cSrcweir                         + sizeof aProjectSlotData / sizeof (SlotAccessId) );
111cdf0e10cSrcweir     return aSlots;
112cdf0e10cSrcweir }
113cdf0e10cSrcweir 
114cdf0e10cSrcweir DYN Slot *
inq_Create_Slot(SlotAccessId i_nSlot) const115cdf0e10cSrcweir Enum::inq_Create_Slot( SlotAccessId  i_nSlot ) const
116cdf0e10cSrcweir {
117cdf0e10cSrcweir     switch ( i_nSlot )
118cdf0e10cSrcweir     {
119cdf0e10cSrcweir         case SLOT_Values:               return new Slot_SequentialIds<Ce_id>(aValues);
120cdf0e10cSrcweir         default:
121cdf0e10cSrcweir                                         return new Slot_Null;
122cdf0e10cSrcweir     }   // end switch
123cdf0e10cSrcweir }
124cdf0e10cSrcweir 
125cdf0e10cSrcweir 
126cdf0e10cSrcweir 
127cdf0e10cSrcweir }   // namespace cpp
128cdf0e10cSrcweir }   // namespace ary
129