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_structelem.hxx>
24 #include <ary/idl/ik_structelem.hxx>
25 
26 
27 // NOT FULLY DECLARED SERVICES
28 #include <cosv/tpl/processor.hxx>
29 #include <sci_impl.hxx>
30 
31 
32 namespace ary
33 {
34 namespace idl
35 {
36 
37 
StructElement(const String & i_sName,Ce_id i_nOwner,Ce_id i_nNameRoom,Type_id i_nType)38 StructElement::StructElement( const String &      i_sName,
39                               Ce_id               i_nOwner,
40                               Ce_id               i_nNameRoom,
41                               Type_id             i_nType )
42     :   sName(i_sName),
43         nOwner(i_nOwner),
44         nNameRoom(i_nNameRoom),
45         nType(i_nType)
46 {
47 }
48 
~StructElement()49 StructElement::~StructElement()
50 {
51 }
52 
53 void
do_Accept(csv::ProcessorIfc & io_processor) const54 StructElement::do_Accept( csv::ProcessorIfc & io_processor ) const
55 {
56     csv::CheckedCall(io_processor, *this);
57 }
58 
59 ClassId
get_AryClass() const60 StructElement::get_AryClass() const
61 {
62     return class_id;
63 }
64 
65 const String &
inq_LocalName() const66 StructElement::inq_LocalName() const
67 {
68     return sName;
69 }
70 
71 Ce_id
inq_NameRoom() const72 StructElement::inq_NameRoom() const
73 {
74     return nNameRoom;
75 }
76 
77 Ce_id
inq_Owner() const78 StructElement::inq_Owner() const
79 {
80     return nOwner;
81 }
82 
83 E_SightLevel
inq_SightLevel() const84 StructElement::inq_SightLevel() const
85 {
86     return sl_Member;
87 }
88 
89 
90 namespace ifc_structelement
91 {
92 
93 inline const StructElement &
selem_cast(const CodeEntity & i_ce)94 selem_cast( const CodeEntity &  i_ce )
95 {
96     csv_assert( i_ce.AryClass() == StructElement::class_id );
97 	return static_cast< const StructElement& >(i_ce);
98 }
99 
100 Type_id
Type(const CodeEntity & i_ce)101 attr::Type( const CodeEntity & i_ce )
102 {
103     return selem_cast(i_ce).nType;
104 }
105 
106 } // namespace ifc_structelement
107 
108 
109 
110 }   //  namespace   idl
111 }   //  namespace   ary
112