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_exception.hxx>
24 #include <ary/idl/ik_exception.hxx>
25 
26 
27 // NOT FULLY DECLARED SERVICES
28 #include <cosv/tpl/processor.hxx>
29 #include <sci_impl.hxx>
30 #include "i2s_calculator.hxx"
31 
32 
33 
34 namespace ary
35 {
36 namespace idl
37 {
38 
Exception(const String & i_sName,Ce_id i_nOwner,Type_id i_nBase)39 Exception::Exception( const String &      i_sName,
40                       Ce_id               i_nOwner,
41                       Type_id             i_nBase )
42     :   sName(i_sName),
43         nOwner(i_nOwner),
44         nBase(i_nBase),
45         aElements()
46 {
47 }
48 
~Exception()49 Exception::~Exception()
50 {
51 }
52 
53 void
do_Accept(csv::ProcessorIfc & io_processor) const54 Exception::do_Accept( csv::ProcessorIfc & io_processor ) const
55 {
56     csv::CheckedCall(io_processor, *this);
57 }
58 
59 ClassId
get_AryClass() const60 Exception::get_AryClass() const
61 {
62     return class_id;
63 }
64 
65 const String &
inq_LocalName() const66 Exception::inq_LocalName() const
67 {
68     return sName;
69 }
70 
71 Ce_id
inq_NameRoom() const72 Exception::inq_NameRoom() const
73 {
74     return nOwner;
75 }
76 
77 Ce_id
inq_Owner() const78 Exception::inq_Owner() const
79 {
80     return nOwner;
81 }
82 
83 E_SightLevel
inq_SightLevel() const84 Exception::inq_SightLevel() const
85 {
86     return sl_File;
87 }
88 
89 
90 namespace ifc_exception
91 {
92 
93 inline const Exception &
exception_cast(const CodeEntity & i_ce)94 exception_cast( const CodeEntity &  i_ce )
95 {
96     csv_assert( i_ce.AryClass() == Exception::class_id );
97 	return static_cast< const Exception& >(i_ce);
98 }
99 
100 Type_id
Base(const CodeEntity & i_ce)101 attr::Base( const CodeEntity & i_ce )
102 {
103     return exception_cast(i_ce).nBase;
104 }
105 
106 void
Get_Elements(Dyn_CeIterator & o_result,const CodeEntity & i_ce)107 attr::Get_Elements( Dyn_CeIterator &    o_result,
108                     const CodeEntity &  i_ce )
109 {
110     o_result = new SCI_Vector<Ce_id>( exception_cast(i_ce).aElements );
111 }
112 
113 
114 void
Get_Derivations(Dyn_CeIterator & o_result,const CodeEntity & i_ce)115 xref::Get_Derivations( Dyn_CeIterator &    o_result,
116                        const CodeEntity &  i_ce )
117 {
118     o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(exception_2s_Derivations));
119 }
120 
121 void
Get_RaisingFunctions(Dyn_CeIterator & o_result,const CodeEntity & i_ce)122 xref::Get_RaisingFunctions( Dyn_CeIterator &    o_result,
123                             const CodeEntity &  i_ce )
124 {
125     o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(exception_2s_RaisingFunctions));
126 }
127 
128 
129 } // namespace ifc_exception
130 
131 
132 }   //  namespace   idl
133 }   //  namespace   ary
134