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_constgroup.hxx>
24 #include <ary/idl/ik_constgroup.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 
ConstantsGroup(const String & i_sName,Ce_id i_nModule)38 ConstantsGroup::ConstantsGroup( const String &      i_sName,
39                                 Ce_id               i_nModule )
40     :   sName(i_sName),
41         nModule(i_nModule),
42         aConstants()
43 {
44 }
45 
~ConstantsGroup()46 ConstantsGroup::~ConstantsGroup()
47 {
48 }
49 
50 void
do_Accept(csv::ProcessorIfc & io_processor) const51 ConstantsGroup::do_Accept( csv::ProcessorIfc & io_processor ) const
52 {
53     csv::CheckedCall(io_processor, *this);
54 }
55 
56 ClassId
get_AryClass() const57 ConstantsGroup::get_AryClass() const
58 {
59     return class_id;
60 }
61 
62 const String &
inq_LocalName() const63 ConstantsGroup::inq_LocalName() const
64 {
65     return sName;
66 }
67 
68 Ce_id
inq_NameRoom() const69 ConstantsGroup::inq_NameRoom() const
70 {
71     return nModule;
72 }
73 
74 Ce_id
inq_Owner() const75 ConstantsGroup::inq_Owner() const
76 {
77     return nModule;
78 }
79 
80 E_SightLevel
inq_SightLevel() const81 ConstantsGroup::inq_SightLevel() const
82 {
83     return sl_File;
84 }
85 
86 
87 namespace ifc_constgroup
88 {
89 
90 inline const ConstantsGroup &
constgroup_cast(const CodeEntity & i_ce)91 constgroup_cast( const CodeEntity & i_ce )
92 {
93     csv_assert( i_ce.AryClass() == ConstantsGroup::class_id );
94 	return static_cast< const ConstantsGroup& >(i_ce);
95 }
96 
97 void
Get_Constants(Dyn_CeIterator & o_result,const CodeEntity & i_ce)98 attr::Get_Constants( Dyn_CeIterator &    o_result,
99                      const CodeEntity &  i_ce )
100 {
101     o_result = new SCI_Vector<Ce_id>(constgroup_cast(i_ce).aConstants);
102 }
103 
104 } // namespace ifc_constgroup
105 
106 
107 }   //  namespace   idl
108 }   //  namespace   ary
109