xref: /aoo41x/main/autodoc/source/ary/idl/i_struct.cxx (revision 78bc99aa)
1*78bc99aaSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*78bc99aaSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*78bc99aaSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*78bc99aaSAndrew Rist  * distributed with this work for additional information
6*78bc99aaSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*78bc99aaSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*78bc99aaSAndrew Rist  * "License"); you may not use this file except in compliance
9*78bc99aaSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*78bc99aaSAndrew Rist  *
11*78bc99aaSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*78bc99aaSAndrew Rist  *
13*78bc99aaSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*78bc99aaSAndrew Rist  * software distributed under the License is distributed on an
15*78bc99aaSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*78bc99aaSAndrew Rist  * KIND, either express or implied.  See the License for the
17*78bc99aaSAndrew Rist  * specific language governing permissions and limitations
18*78bc99aaSAndrew Rist  * under the License.
19*78bc99aaSAndrew Rist  *
20*78bc99aaSAndrew Rist  *************************************************************/
21cdf0e10cSrcweir 
22cdf0e10cSrcweir #include <precomp.h>
23cdf0e10cSrcweir #include <ary/idl/i_struct.hxx>
24cdf0e10cSrcweir #include <ary/idl/ik_struct.hxx>
25cdf0e10cSrcweir 
26cdf0e10cSrcweir 
27cdf0e10cSrcweir // NOT FULLY DECLARED SERVICES
28cdf0e10cSrcweir #include <cosv/tpl/processor.hxx>
29cdf0e10cSrcweir #include <sci_impl.hxx>
30cdf0e10cSrcweir #include "i2s_calculator.hxx"
31cdf0e10cSrcweir 
32cdf0e10cSrcweir 
33cdf0e10cSrcweir namespace ary
34cdf0e10cSrcweir {
35cdf0e10cSrcweir namespace idl
36cdf0e10cSrcweir {
37cdf0e10cSrcweir 
Struct(const String & i_sName,Ce_id i_nOwner,Type_id i_nBase,const String & i_sTemplateParameter,Type_id i_nTemplateParameterType)38cdf0e10cSrcweir Struct::Struct( const String &      i_sName,
39cdf0e10cSrcweir                 Ce_id               i_nOwner,
40cdf0e10cSrcweir                 Type_id             i_nBase,
41cdf0e10cSrcweir                 const String &      i_sTemplateParameter,
42cdf0e10cSrcweir                 Type_id             i_nTemplateParameterType )
43cdf0e10cSrcweir     :   sName(i_sName),
44cdf0e10cSrcweir         nOwner(i_nOwner),
45cdf0e10cSrcweir         nBase(i_nBase),
46cdf0e10cSrcweir         sTemplateParameter(i_sTemplateParameter),
47cdf0e10cSrcweir         nTemplateParameterType(i_nTemplateParameterType),
48cdf0e10cSrcweir         aElements()
49cdf0e10cSrcweir {
50cdf0e10cSrcweir }
51cdf0e10cSrcweir 
~Struct()52cdf0e10cSrcweir Struct::~Struct()
53cdf0e10cSrcweir {
54cdf0e10cSrcweir }
55cdf0e10cSrcweir 
56cdf0e10cSrcweir void
do_Accept(csv::ProcessorIfc & io_processor) const57cdf0e10cSrcweir Struct::do_Accept( csv::ProcessorIfc & io_processor ) const
58cdf0e10cSrcweir {
59cdf0e10cSrcweir     csv::CheckedCall(io_processor, *this);
60cdf0e10cSrcweir }
61cdf0e10cSrcweir 
62cdf0e10cSrcweir ClassId
get_AryClass() const63cdf0e10cSrcweir Struct::get_AryClass() const
64cdf0e10cSrcweir {
65cdf0e10cSrcweir     return class_id;
66cdf0e10cSrcweir }
67cdf0e10cSrcweir 
68cdf0e10cSrcweir const String &
inq_LocalName() const69cdf0e10cSrcweir Struct::inq_LocalName() const
70cdf0e10cSrcweir {
71cdf0e10cSrcweir     return sName;
72cdf0e10cSrcweir }
73cdf0e10cSrcweir 
74cdf0e10cSrcweir Ce_id
inq_NameRoom() const75cdf0e10cSrcweir Struct::inq_NameRoom() const
76cdf0e10cSrcweir {
77cdf0e10cSrcweir     return nOwner;
78cdf0e10cSrcweir }
79cdf0e10cSrcweir 
80cdf0e10cSrcweir Ce_id
inq_Owner() const81cdf0e10cSrcweir Struct::inq_Owner() const
82cdf0e10cSrcweir {
83cdf0e10cSrcweir     return nOwner;
84cdf0e10cSrcweir }
85cdf0e10cSrcweir 
86cdf0e10cSrcweir E_SightLevel
inq_SightLevel() const87cdf0e10cSrcweir Struct::inq_SightLevel() const
88cdf0e10cSrcweir {
89cdf0e10cSrcweir     return sl_File;
90cdf0e10cSrcweir }
91cdf0e10cSrcweir 
92cdf0e10cSrcweir 
93cdf0e10cSrcweir namespace ifc_struct
94cdf0e10cSrcweir {
95cdf0e10cSrcweir 
96cdf0e10cSrcweir inline const Struct &
struct_cast(const CodeEntity & i_ce)97cdf0e10cSrcweir struct_cast( const CodeEntity &  i_ce )
98cdf0e10cSrcweir {
99cdf0e10cSrcweir     csv_assert( i_ce.AryClass() == Struct::class_id );
100cdf0e10cSrcweir 	return static_cast< const Struct& >(i_ce);
101cdf0e10cSrcweir }
102cdf0e10cSrcweir 
103cdf0e10cSrcweir Type_id
Base(const CodeEntity & i_ce)104cdf0e10cSrcweir attr::Base( const CodeEntity & i_ce )
105cdf0e10cSrcweir {
106cdf0e10cSrcweir     return struct_cast(i_ce).nBase;
107cdf0e10cSrcweir }
108cdf0e10cSrcweir 
109cdf0e10cSrcweir void
Get_Elements(Dyn_CeIterator & o_result,const CodeEntity & i_ce)110cdf0e10cSrcweir attr::Get_Elements( Dyn_CeIterator &    o_result,
111cdf0e10cSrcweir                     const CodeEntity &  i_ce )
112cdf0e10cSrcweir {
113cdf0e10cSrcweir     o_result = new SCI_Vector<Ce_id>( struct_cast(i_ce).aElements );
114cdf0e10cSrcweir }
115cdf0e10cSrcweir 
116cdf0e10cSrcweir 
117cdf0e10cSrcweir void
Get_Derivations(Dyn_CeIterator & o_result,const CodeEntity & i_ce)118cdf0e10cSrcweir xref::Get_Derivations( Dyn_CeIterator &    o_result,
119cdf0e10cSrcweir                        const CodeEntity &  i_ce )
120cdf0e10cSrcweir {
121cdf0e10cSrcweir     o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(struct_2s_Derivations));
122cdf0e10cSrcweir }
123cdf0e10cSrcweir 
124cdf0e10cSrcweir void
Get_SynonymTypedefs(Dyn_CeIterator & o_result,const CodeEntity & i_ce)125cdf0e10cSrcweir xref::Get_SynonymTypedefs( Dyn_CeIterator &    o_result,
126cdf0e10cSrcweir                            const CodeEntity &  i_ce )
127cdf0e10cSrcweir {
128cdf0e10cSrcweir     o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(struct_2s_SynonymTypedefs));
129cdf0e10cSrcweir }
130cdf0e10cSrcweir 
131cdf0e10cSrcweir void
Get_AsReturns(Dyn_CeIterator & o_result,const CodeEntity & i_ce)132cdf0e10cSrcweir xref::Get_AsReturns( Dyn_CeIterator &    o_result,
133cdf0e10cSrcweir                      const CodeEntity &  i_ce )
134cdf0e10cSrcweir {
135cdf0e10cSrcweir     o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(struct_2s_AsReturns));
136cdf0e10cSrcweir }
137cdf0e10cSrcweir 
138cdf0e10cSrcweir void
Get_AsParameters(Dyn_CeIterator & o_result,const CodeEntity & i_ce)139cdf0e10cSrcweir xref::Get_AsParameters( Dyn_CeIterator &    o_result,
140cdf0e10cSrcweir                         const CodeEntity &  i_ce )
141cdf0e10cSrcweir {
142cdf0e10cSrcweir     o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(struct_2s_AsParameters));
143cdf0e10cSrcweir }
144cdf0e10cSrcweir 
145cdf0e10cSrcweir void
Get_AsDataTypes(Dyn_CeIterator & o_result,const CodeEntity & i_ce)146cdf0e10cSrcweir xref::Get_AsDataTypes( Dyn_CeIterator &    o_result,
147cdf0e10cSrcweir                        const CodeEntity &  i_ce )
148cdf0e10cSrcweir {
149cdf0e10cSrcweir     o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(struct_2s_AsDataTypes));
150cdf0e10cSrcweir }
151cdf0e10cSrcweir 
152cdf0e10cSrcweir } // namespace ifc_struct
153cdf0e10cSrcweir 
154cdf0e10cSrcweir 
155cdf0e10cSrcweir 
156cdf0e10cSrcweir }   //  namespace   idl
157cdf0e10cSrcweir }   //  namespace   ary
158