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