1*78bc99aaSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*78bc99aaSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*78bc99aaSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*78bc99aaSAndrew Rist  * distributed with this work for additional information
6*78bc99aaSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*78bc99aaSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*78bc99aaSAndrew Rist  * "License"); you may not use this file except in compliance
9*78bc99aaSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*78bc99aaSAndrew Rist  *
11*78bc99aaSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*78bc99aaSAndrew Rist  *
13*78bc99aaSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*78bc99aaSAndrew Rist  * software distributed under the License is distributed on an
15*78bc99aaSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*78bc99aaSAndrew Rist  * KIND, either express or implied.  See the License for the
17*78bc99aaSAndrew Rist  * specific language governing permissions and limitations
18*78bc99aaSAndrew Rist  * under the License.
19*78bc99aaSAndrew Rist  *
20*78bc99aaSAndrew Rist  *************************************************************/
21cdf0e10cSrcweir 
22cdf0e10cSrcweir #include <precomp.h>
23cdf0e10cSrcweir #include <ary/idl/i_enumvalue.hxx>
24cdf0e10cSrcweir 
25cdf0e10cSrcweir 
26cdf0e10cSrcweir // NOT FULLY DECLARED SERVICES
27cdf0e10cSrcweir #include <cosv/tpl/processor.hxx>
28cdf0e10cSrcweir #include <ary/idl/ik_enumvalue.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir 
31cdf0e10cSrcweir namespace ary
32cdf0e10cSrcweir {
33cdf0e10cSrcweir namespace idl
34cdf0e10cSrcweir {
35cdf0e10cSrcweir 
EnumValue(const String & i_sName,Ce_id i_nOwner,Ce_id i_nNameRoom,const String & i_sInitValue)36cdf0e10cSrcweir EnumValue::EnumValue( const String &      i_sName,
37cdf0e10cSrcweir                       Ce_id               i_nOwner,
38cdf0e10cSrcweir                       Ce_id               i_nNameRoom,
39cdf0e10cSrcweir                       const String &      i_sInitValue )
40cdf0e10cSrcweir     :   sName(i_sName),
41cdf0e10cSrcweir         nOwner(i_nOwner),
42cdf0e10cSrcweir         nNameRoom(i_nNameRoom),
43cdf0e10cSrcweir         sValue(i_sInitValue)
44cdf0e10cSrcweir {
45cdf0e10cSrcweir }
46cdf0e10cSrcweir 
~EnumValue()47cdf0e10cSrcweir EnumValue::~EnumValue()
48cdf0e10cSrcweir {
49cdf0e10cSrcweir }
50cdf0e10cSrcweir 
51cdf0e10cSrcweir void
do_Accept(csv::ProcessorIfc & io_processor) const52cdf0e10cSrcweir EnumValue::do_Accept( csv::ProcessorIfc & io_processor ) const
53cdf0e10cSrcweir {
54cdf0e10cSrcweir     csv::CheckedCall(io_processor, *this);
55cdf0e10cSrcweir }
56cdf0e10cSrcweir 
57cdf0e10cSrcweir ClassId
get_AryClass() const58cdf0e10cSrcweir EnumValue::get_AryClass() const
59cdf0e10cSrcweir {
60cdf0e10cSrcweir     return class_id;
61cdf0e10cSrcweir }
62cdf0e10cSrcweir 
63cdf0e10cSrcweir const String &
inq_LocalName() const64cdf0e10cSrcweir EnumValue::inq_LocalName() const
65cdf0e10cSrcweir {
66cdf0e10cSrcweir     return sName;
67cdf0e10cSrcweir }
68cdf0e10cSrcweir 
69cdf0e10cSrcweir Ce_id
inq_NameRoom() const70cdf0e10cSrcweir EnumValue::inq_NameRoom() const
71cdf0e10cSrcweir {
72cdf0e10cSrcweir     return nNameRoom;
73cdf0e10cSrcweir }
74cdf0e10cSrcweir 
75cdf0e10cSrcweir Ce_id
inq_Owner() const76cdf0e10cSrcweir EnumValue::inq_Owner() const
77cdf0e10cSrcweir {
78cdf0e10cSrcweir     return nOwner;
79cdf0e10cSrcweir }
80cdf0e10cSrcweir 
81cdf0e10cSrcweir E_SightLevel
inq_SightLevel() const82cdf0e10cSrcweir EnumValue::inq_SightLevel() const
83cdf0e10cSrcweir {
84cdf0e10cSrcweir     return sl_Member;
85cdf0e10cSrcweir }
86cdf0e10cSrcweir 
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 
89cdf0e10cSrcweir namespace ifc_enumvalue
90cdf0e10cSrcweir {
91cdf0e10cSrcweir 
92cdf0e10cSrcweir inline const EnumValue &
enumvalue_cast(const CodeEntity & i_ce)93cdf0e10cSrcweir enumvalue_cast( const CodeEntity &  i_ce )
94cdf0e10cSrcweir {
95cdf0e10cSrcweir     csv_assert( i_ce.AryClass() == EnumValue::class_id );
96cdf0e10cSrcweir 	return static_cast< const EnumValue& >(i_ce);
97cdf0e10cSrcweir }
98cdf0e10cSrcweir 
99cdf0e10cSrcweir const String &
Value(const CodeEntity & i_ce)100cdf0e10cSrcweir attr::Value( const CodeEntity & i_ce )
101cdf0e10cSrcweir {
102cdf0e10cSrcweir     return enumvalue_cast(i_ce).sValue;
103cdf0e10cSrcweir }
104cdf0e10cSrcweir 
105cdf0e10cSrcweir 
106cdf0e10cSrcweir } // namespace ifc_enumvalue
107cdf0e10cSrcweir 
108cdf0e10cSrcweir 
109cdf0e10cSrcweir }   //  namespace   idl
110cdf0e10cSrcweir }   //  namespace   ary
111