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/idl/i_attribute.hxx>
24cdf0e10cSrcweir #include <ary/idl/ik_attribute.hxx>
25cdf0e10cSrcweir 
26cdf0e10cSrcweir 
27cdf0e10cSrcweir // NOT FULLY DECLARED SERVICES
28cdf0e10cSrcweir #include <cosv/tpl/processor.hxx>
29cdf0e10cSrcweir #include <ary/getncast.hxx>
30cdf0e10cSrcweir #include <sci_impl.hxx>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir 
33cdf0e10cSrcweir namespace ary
34cdf0e10cSrcweir {
35cdf0e10cSrcweir namespace idl
36cdf0e10cSrcweir {
37cdf0e10cSrcweir 
38cdf0e10cSrcweir 
Attribute(const String & i_sName,Ce_id i_nService,Ce_id i_nModule,Type_id i_nType,bool i_bReadonly,bool i_bBound)39cdf0e10cSrcweir Attribute::Attribute( const String &      i_sName,
40cdf0e10cSrcweir                       Ce_id               i_nService,
41cdf0e10cSrcweir 					  Ce_id               i_nModule,
42cdf0e10cSrcweir 					  Type_id             i_nType,
43cdf0e10cSrcweir 					  bool                i_bReadonly,
44cdf0e10cSrcweir 					  bool                i_bBound )
45cdf0e10cSrcweir     :   sName(i_sName),
46cdf0e10cSrcweir         nOwner(i_nService),
47cdf0e10cSrcweir         nNameRoom(i_nModule),
48cdf0e10cSrcweir         nType(i_nType),
49cdf0e10cSrcweir         aGetExceptions(),
50cdf0e10cSrcweir         aSetExceptions(),
51cdf0e10cSrcweir         bReadonly(i_bReadonly),
52cdf0e10cSrcweir         bBound(i_bBound)
53cdf0e10cSrcweir {
54cdf0e10cSrcweir }
55cdf0e10cSrcweir 
~Attribute()56cdf0e10cSrcweir Attribute::~Attribute()
57cdf0e10cSrcweir {
58cdf0e10cSrcweir }
59cdf0e10cSrcweir 
60cdf0e10cSrcweir 
61cdf0e10cSrcweir void
do_Accept(csv::ProcessorIfc & io_processor) const62cdf0e10cSrcweir Attribute::do_Accept(csv::ProcessorIfc & io_processor) const
63cdf0e10cSrcweir {
64cdf0e10cSrcweir     csv::CheckedCall(io_processor,*this);
65cdf0e10cSrcweir }
66cdf0e10cSrcweir 
67cdf0e10cSrcweir ClassId
get_AryClass() const68cdf0e10cSrcweir Attribute::get_AryClass() const
69cdf0e10cSrcweir {
70cdf0e10cSrcweir     return class_id;
71cdf0e10cSrcweir }
72cdf0e10cSrcweir 
73cdf0e10cSrcweir const String &
inq_LocalName() const74cdf0e10cSrcweir Attribute::inq_LocalName() const
75cdf0e10cSrcweir {
76cdf0e10cSrcweir     return sName;
77cdf0e10cSrcweir }
78cdf0e10cSrcweir 
79cdf0e10cSrcweir Ce_id
inq_NameRoom() const80cdf0e10cSrcweir Attribute::inq_NameRoom() const
81cdf0e10cSrcweir {
82cdf0e10cSrcweir     return nNameRoom;
83cdf0e10cSrcweir }
84cdf0e10cSrcweir 
85cdf0e10cSrcweir Ce_id
inq_Owner() const86cdf0e10cSrcweir Attribute::inq_Owner() const
87cdf0e10cSrcweir {
88cdf0e10cSrcweir     return nOwner;
89cdf0e10cSrcweir }
90cdf0e10cSrcweir 
91cdf0e10cSrcweir E_SightLevel
inq_SightLevel() const92cdf0e10cSrcweir Attribute::inq_SightLevel() const
93cdf0e10cSrcweir {
94cdf0e10cSrcweir     return sl_Member;
95cdf0e10cSrcweir }
96cdf0e10cSrcweir 
97cdf0e10cSrcweir namespace ifc_attribute
98cdf0e10cSrcweir {
99cdf0e10cSrcweir 
100cdf0e10cSrcweir inline const Attribute &
attribute_cast(const CodeEntity & i_ce)101cdf0e10cSrcweir attribute_cast( const CodeEntity &  i_ce )
102cdf0e10cSrcweir {
103cdf0e10cSrcweir     csv_assert( is_type<Attribute>(i_ce) );
104cdf0e10cSrcweir 	return static_cast< const Attribute& >(i_ce);
105cdf0e10cSrcweir }
106cdf0e10cSrcweir 
107cdf0e10cSrcweir bool
HasAnyStereotype(const CodeEntity & i_ce)108cdf0e10cSrcweir attr::HasAnyStereotype( const CodeEntity & i_ce )
109cdf0e10cSrcweir {
110cdf0e10cSrcweir     const Attribute & rAttr = attribute_cast(i_ce);
111cdf0e10cSrcweir     return rAttr.bReadonly OR rAttr.bBound;
112cdf0e10cSrcweir }
113cdf0e10cSrcweir 
114cdf0e10cSrcweir bool
IsReadOnly(const CodeEntity & i_ce)115cdf0e10cSrcweir attr::IsReadOnly( const CodeEntity & i_ce )
116cdf0e10cSrcweir {
117cdf0e10cSrcweir     return attribute_cast(i_ce).bReadonly;
118cdf0e10cSrcweir }
119cdf0e10cSrcweir 
120cdf0e10cSrcweir bool
IsBound(const CodeEntity & i_ce)121cdf0e10cSrcweir attr::IsBound( const CodeEntity & i_ce )
122cdf0e10cSrcweir {
123cdf0e10cSrcweir     return attribute_cast(i_ce).bBound;
124cdf0e10cSrcweir }
125cdf0e10cSrcweir 
126cdf0e10cSrcweir Type_id
Type(const CodeEntity & i_ce)127cdf0e10cSrcweir attr::Type( const CodeEntity & i_ce )
128cdf0e10cSrcweir {
129cdf0e10cSrcweir     return attribute_cast(i_ce).nType;
130cdf0e10cSrcweir }
131cdf0e10cSrcweir 
132cdf0e10cSrcweir void
Get_GetExceptions(Dyn_TypeIterator & o_result,const CodeEntity & i_ce)133cdf0e10cSrcweir attr::Get_GetExceptions( Dyn_TypeIterator &  o_result,
134cdf0e10cSrcweir                          const CodeEntity &  i_ce )
135cdf0e10cSrcweir {
136cdf0e10cSrcweir     o_result
137cdf0e10cSrcweir         = new SCI_Vector<Type_id>( attribute_cast(i_ce).aGetExceptions );
138cdf0e10cSrcweir }
139cdf0e10cSrcweir 
140cdf0e10cSrcweir void
Get_SetExceptions(Dyn_TypeIterator & o_result,const CodeEntity & i_ce)141cdf0e10cSrcweir attr::Get_SetExceptions( Dyn_TypeIterator &  o_result,
142cdf0e10cSrcweir                          const CodeEntity &  i_ce )
143cdf0e10cSrcweir {
144cdf0e10cSrcweir     o_result
145cdf0e10cSrcweir         = new SCI_Vector<Type_id>( attribute_cast(i_ce).aSetExceptions );
146cdf0e10cSrcweir }
147cdf0e10cSrcweir 
148cdf0e10cSrcweir 
149cdf0e10cSrcweir } // namespace ifc_attribute
150cdf0e10cSrcweir 
151cdf0e10cSrcweir 
152cdf0e10cSrcweir }   //  namespace   idl
153cdf0e10cSrcweir }   //  namespace   ary
154