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 <ary/idl/i_enumvalue.hxx>
24
25
26 // NOT FULLY DECLARED SERVICES
27 #include <cosv/tpl/processor.hxx>
28 #include <ary/idl/ik_enumvalue.hxx>
29
30
31 namespace ary
32 {
33 namespace idl
34 {
35
EnumValue(const String & i_sName,Ce_id i_nOwner,Ce_id i_nNameRoom,const String & i_sInitValue)36 EnumValue::EnumValue( const String & i_sName,
37 Ce_id i_nOwner,
38 Ce_id i_nNameRoom,
39 const String & i_sInitValue )
40 : sName(i_sName),
41 nOwner(i_nOwner),
42 nNameRoom(i_nNameRoom),
43 sValue(i_sInitValue)
44 {
45 }
46
~EnumValue()47 EnumValue::~EnumValue()
48 {
49 }
50
51 void
do_Accept(csv::ProcessorIfc & io_processor) const52 EnumValue::do_Accept( csv::ProcessorIfc & io_processor ) const
53 {
54 csv::CheckedCall(io_processor, *this);
55 }
56
57 ClassId
get_AryClass() const58 EnumValue::get_AryClass() const
59 {
60 return class_id;
61 }
62
63 const String &
inq_LocalName() const64 EnumValue::inq_LocalName() const
65 {
66 return sName;
67 }
68
69 Ce_id
inq_NameRoom() const70 EnumValue::inq_NameRoom() const
71 {
72 return nNameRoom;
73 }
74
75 Ce_id
inq_Owner() const76 EnumValue::inq_Owner() const
77 {
78 return nOwner;
79 }
80
81 E_SightLevel
inq_SightLevel() const82 EnumValue::inq_SightLevel() const
83 {
84 return sl_Member;
85 }
86
87
88
89 namespace ifc_enumvalue
90 {
91
92 inline const EnumValue &
enumvalue_cast(const CodeEntity & i_ce)93 enumvalue_cast( const CodeEntity & i_ce )
94 {
95 csv_assert( i_ce.AryClass() == EnumValue::class_id );
96 return static_cast< const EnumValue& >(i_ce);
97 }
98
99 const String &
Value(const CodeEntity & i_ce)100 attr::Value( const CodeEntity & i_ce )
101 {
102 return enumvalue_cast(i_ce).sValue;
103 }
104
105
106 } // namespace ifc_enumvalue
107
108
109 } // namespace idl
110 } // namespace ary
111