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_property.hxx>
24 #include <ary/idl/ik_property.hxx>
25 
26 
27 // NOT FULLY DECLARED SERVICES
28 #include <cosv/tpl/processor.hxx>
29 
30 
31 namespace ary
32 {
33 namespace idl
34 {
35 
36 
Property(const String & i_sName,Ce_id i_nService,Ce_id i_nModule,Type_id i_nType,Stereotypes i_stereotypes)37 Property::Property( const String &      i_sName,
38                     Ce_id               i_nService,
39                     Ce_id               i_nModule,
40                     Type_id             i_nType,
41                     Stereotypes         i_stereotypes )
42     :   sName(i_sName),
43         nOwner(i_nService),
44         nNameRoom(i_nModule),
45         nType(i_nType),
46         aStereotypes(i_stereotypes)
47 {
48 }
49 
~Property()50 Property::~Property()
51 {
52 }
53 
54 
55 void
do_Accept(csv::ProcessorIfc & io_processor) const56 Property::do_Accept( csv::ProcessorIfc & io_processor ) const
57 {
58     csv::CheckedCall(io_processor, *this);
59 }
60 
61 ClassId
get_AryClass() const62 Property::get_AryClass() const
63 {
64     return class_id;
65 }
66 
67 const String &
inq_LocalName() const68 Property::inq_LocalName() const
69 {
70     return sName;
71 }
72 
73 Ce_id
inq_NameRoom() const74 Property::inq_NameRoom() const
75 {
76     return nNameRoom;
77 }
78 
79 Ce_id
inq_Owner() const80 Property::inq_Owner() const
81 {
82     return nOwner;
83 }
84 
85 E_SightLevel
inq_SightLevel() const86 Property::inq_SightLevel() const
87 {
88     return sl_Member;
89 }
90 
91 namespace ifc_property
92 {
93 
94 inline const Property &
property_cast(const CodeEntity & i_ce)95 property_cast( const CodeEntity &  i_ce )
96 {
97     csv_assert( i_ce.AryClass() == Property::class_id );
98 	return static_cast< const Property& >(i_ce);
99 }
100 
101 bool
HasAnyStereotype(const CodeEntity & i_ce)102 attr::HasAnyStereotype( const CodeEntity &  i_ce )
103 {
104     return property_cast(i_ce).aStereotypes.HasAny();
105 }
106 
107 bool
IsReadOnly(const CodeEntity & i_ce)108 attr::IsReadOnly( const CodeEntity & i_ce )
109 {
110     return property_cast(i_ce).aStereotypes.IsReadOnly();
111 }
112 
113 bool
IsBound(const CodeEntity & i_ce)114 attr::IsBound( const CodeEntity & i_ce )
115 {
116     return property_cast(i_ce).aStereotypes.IsBound();
117 }
118 
119 bool
IsConstrained(const CodeEntity & i_ce)120 attr::IsConstrained( const CodeEntity & i_ce )
121 {
122     return property_cast(i_ce).aStereotypes.IsConstrained();
123 }
124 
125 bool
IsMayBeAmbiguous(const CodeEntity & i_ce)126 attr::IsMayBeAmbiguous( const CodeEntity & i_ce )
127 {
128     return property_cast(i_ce).aStereotypes.IsMayBeAmbiguous();
129 }
130 
131 bool
IsMayBeDefault(const CodeEntity & i_ce)132 attr::IsMayBeDefault( const CodeEntity & i_ce )
133 {
134     return property_cast(i_ce).aStereotypes.IsMayBeDefault();
135 }
136 
137 bool
IsMayBeVoid(const CodeEntity & i_ce)138 attr::IsMayBeVoid( const CodeEntity & i_ce )
139 {
140     return property_cast(i_ce).aStereotypes.IsMayBeVoid();
141 }
142 
143 bool
IsRemovable(const CodeEntity & i_ce)144 attr::IsRemovable( const CodeEntity & i_ce )
145 {
146     return property_cast(i_ce).aStereotypes.IsRemovable();
147 }
148 
149 bool
IsTransient(const CodeEntity & i_ce)150 attr::IsTransient( const CodeEntity & i_ce )
151 {
152     return property_cast(i_ce).aStereotypes.IsTransient();
153 }
154 
155 Type_id
Type(const CodeEntity & i_ce)156 attr::Type( const CodeEntity & i_ce )
157 {
158     return property_cast(i_ce).nType;
159 }
160 
161 } // namespace ifc_property
162 
163 
164 }   //  namespace   idl
165 }   //  namespace   ary
166