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_interface.hxx>
24cdf0e10cSrcweir
25cdf0e10cSrcweir
26cdf0e10cSrcweir // NOT FULLY DECLARED SERVICES
27cdf0e10cSrcweir #include <cosv/tpl/processor.hxx>
28cdf0e10cSrcweir #include <ary/idl/ik_interface.hxx>
29cdf0e10cSrcweir #include <ary/doc/d_oldidldocu.hxx>
30cdf0e10cSrcweir #include <sci_impl.hxx>
31cdf0e10cSrcweir #include "i2s_calculator.hxx"
32cdf0e10cSrcweir
33cdf0e10cSrcweir
34cdf0e10cSrcweir namespace ary
35cdf0e10cSrcweir {
36cdf0e10cSrcweir namespace idl
37cdf0e10cSrcweir {
38cdf0e10cSrcweir
39cdf0e10cSrcweir
40cdf0e10cSrcweir class Interface_2s
41cdf0e10cSrcweir {
42cdf0e10cSrcweir };
43cdf0e10cSrcweir
44cdf0e10cSrcweir
Interface(const String & i_sName,Ce_id i_nOwner)45cdf0e10cSrcweir Interface::Interface( const String & i_sName,
46cdf0e10cSrcweir Ce_id i_nOwner )
47cdf0e10cSrcweir : sName(i_sName),
48cdf0e10cSrcweir nOwner(i_nOwner),
49cdf0e10cSrcweir aBases(),
50cdf0e10cSrcweir aFunctions(),
51cdf0e10cSrcweir aAttributes(),
52cdf0e10cSrcweir p2s()
53cdf0e10cSrcweir {
54cdf0e10cSrcweir }
55cdf0e10cSrcweir
~Interface()56cdf0e10cSrcweir Interface::~Interface()
57cdf0e10cSrcweir {
58cdf0e10cSrcweir for ( RelationList::iterator it = aBases.begin();
59cdf0e10cSrcweir it != aBases.end();
60cdf0e10cSrcweir ++it )
61cdf0e10cSrcweir {
62cdf0e10cSrcweir delete (*it).Info();
63cdf0e10cSrcweir }
64cdf0e10cSrcweir }
65cdf0e10cSrcweir
66cdf0e10cSrcweir void
do_Accept(csv::ProcessorIfc & io_processor) const67cdf0e10cSrcweir Interface::do_Accept( csv::ProcessorIfc & io_processor ) const
68cdf0e10cSrcweir {
69cdf0e10cSrcweir csv::CheckedCall(io_processor, *this);
70cdf0e10cSrcweir }
71cdf0e10cSrcweir
72cdf0e10cSrcweir ClassId
get_AryClass() const73cdf0e10cSrcweir Interface::get_AryClass() const
74cdf0e10cSrcweir {
75cdf0e10cSrcweir return class_id;
76cdf0e10cSrcweir }
77cdf0e10cSrcweir
78cdf0e10cSrcweir const String &
inq_LocalName() const79cdf0e10cSrcweir Interface::inq_LocalName() const
80cdf0e10cSrcweir {
81cdf0e10cSrcweir return sName;
82cdf0e10cSrcweir }
83cdf0e10cSrcweir
84cdf0e10cSrcweir Ce_id
inq_NameRoom() const85cdf0e10cSrcweir Interface::inq_NameRoom() const
86cdf0e10cSrcweir {
87cdf0e10cSrcweir return nOwner;
88cdf0e10cSrcweir }
89cdf0e10cSrcweir
90cdf0e10cSrcweir Ce_id
inq_Owner() const91cdf0e10cSrcweir Interface::inq_Owner() const
92cdf0e10cSrcweir {
93cdf0e10cSrcweir return nOwner;
94cdf0e10cSrcweir }
95cdf0e10cSrcweir
96cdf0e10cSrcweir E_SightLevel
inq_SightLevel() const97cdf0e10cSrcweir Interface::inq_SightLevel() const
98cdf0e10cSrcweir {
99cdf0e10cSrcweir return sl_File;
100cdf0e10cSrcweir }
101cdf0e10cSrcweir
102cdf0e10cSrcweir
103cdf0e10cSrcweir namespace ifc_interface
104cdf0e10cSrcweir {
105cdf0e10cSrcweir
106cdf0e10cSrcweir inline const Interface &
interface_cast(const CodeEntity & i_ce)107cdf0e10cSrcweir interface_cast( const CodeEntity & i_ce )
108cdf0e10cSrcweir {
109cdf0e10cSrcweir csv_assert( i_ce.AryClass() == Interface::class_id );
110cdf0e10cSrcweir return static_cast< const Interface& >(i_ce);
111cdf0e10cSrcweir }
112cdf0e10cSrcweir
113cdf0e10cSrcweir void
Get_Bases(Dyn_StdConstIterator<CommentedRelation> & o_result,const CodeEntity & i_ce)114cdf0e10cSrcweir attr::Get_Bases( Dyn_StdConstIterator<CommentedRelation> & o_result,
115cdf0e10cSrcweir const CodeEntity & i_ce )
116cdf0e10cSrcweir {
117cdf0e10cSrcweir o_result = new SCI_Vector<CommentedRelation>(interface_cast(i_ce).aBases);
118cdf0e10cSrcweir }
119cdf0e10cSrcweir
120cdf0e10cSrcweir void
Get_Functions(Dyn_CeIterator & o_result,const CodeEntity & i_ce)121cdf0e10cSrcweir attr::Get_Functions( Dyn_CeIterator & o_result,
122cdf0e10cSrcweir const CodeEntity & i_ce )
123cdf0e10cSrcweir {
124cdf0e10cSrcweir o_result = new SCI_Vector<Ce_id>(interface_cast(i_ce).aFunctions);
125cdf0e10cSrcweir }
126cdf0e10cSrcweir
127cdf0e10cSrcweir void
Get_Attributes(Dyn_CeIterator & o_result,const CodeEntity & i_ce)128cdf0e10cSrcweir attr::Get_Attributes( Dyn_CeIterator & o_result,
129cdf0e10cSrcweir const CodeEntity & i_ce )
130cdf0e10cSrcweir {
131cdf0e10cSrcweir o_result = new SCI_Vector<Ce_id>(interface_cast(i_ce).aAttributes);
132cdf0e10cSrcweir }
133cdf0e10cSrcweir
134cdf0e10cSrcweir void
Get_Derivations(Dyn_CeIterator & o_result,const CodeEntity & i_ce)135cdf0e10cSrcweir xref::Get_Derivations( Dyn_CeIterator & o_result,
136cdf0e10cSrcweir const CodeEntity & i_ce )
137cdf0e10cSrcweir {
138cdf0e10cSrcweir o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_Derivations));
139cdf0e10cSrcweir }
140cdf0e10cSrcweir
141cdf0e10cSrcweir void
Get_SynonymTypedefs(Dyn_CeIterator & o_result,const CodeEntity & i_ce)142cdf0e10cSrcweir xref::Get_SynonymTypedefs( Dyn_CeIterator & o_result,
143cdf0e10cSrcweir const CodeEntity & i_ce )
144cdf0e10cSrcweir {
145cdf0e10cSrcweir o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_SynonymTypedefs));
146cdf0e10cSrcweir }
147cdf0e10cSrcweir
148cdf0e10cSrcweir void
Get_ExportingServices(Dyn_CeIterator & o_result,const CodeEntity & i_ce)149cdf0e10cSrcweir xref::Get_ExportingServices( Dyn_CeIterator & o_result,
150cdf0e10cSrcweir const CodeEntity & i_ce )
151cdf0e10cSrcweir {
152cdf0e10cSrcweir o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_ExportingServices));
153cdf0e10cSrcweir }
154cdf0e10cSrcweir
155cdf0e10cSrcweir void
Get_ExportingSingletons(Dyn_CeIterator & o_result,const CodeEntity & i_ce)156cdf0e10cSrcweir xref::Get_ExportingSingletons( Dyn_CeIterator & o_result,
157cdf0e10cSrcweir const CodeEntity & i_ce )
158cdf0e10cSrcweir {
159cdf0e10cSrcweir o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_ExportingSingletons));
160cdf0e10cSrcweir }
161cdf0e10cSrcweir
162cdf0e10cSrcweir void
Get_AsReturns(Dyn_CeIterator & o_result,const CodeEntity & i_ce)163cdf0e10cSrcweir xref::Get_AsReturns( Dyn_CeIterator & o_result,
164cdf0e10cSrcweir const CodeEntity & i_ce )
165cdf0e10cSrcweir {
166cdf0e10cSrcweir o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_AsReturns));
167cdf0e10cSrcweir }
168cdf0e10cSrcweir
169cdf0e10cSrcweir void
Get_AsParameters(Dyn_CeIterator & o_result,const CodeEntity & i_ce)170cdf0e10cSrcweir xref::Get_AsParameters( Dyn_CeIterator & o_result,
171cdf0e10cSrcweir const CodeEntity & i_ce )
172cdf0e10cSrcweir {
173cdf0e10cSrcweir o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_AsParameters));
174cdf0e10cSrcweir }
175cdf0e10cSrcweir
176cdf0e10cSrcweir void
Get_AsDataTypes(Dyn_CeIterator & o_result,const CodeEntity & i_ce)177cdf0e10cSrcweir xref::Get_AsDataTypes( Dyn_CeIterator & o_result,
178cdf0e10cSrcweir const CodeEntity & i_ce )
179cdf0e10cSrcweir {
180cdf0e10cSrcweir o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_AsDataTypes));
181cdf0e10cSrcweir }
182cdf0e10cSrcweir
183cdf0e10cSrcweir
184cdf0e10cSrcweir
185cdf0e10cSrcweir
186cdf0e10cSrcweir } // namespace ifc_interface
187cdf0e10cSrcweir
188cdf0e10cSrcweir
189cdf0e10cSrcweir } // namespace idl
190cdf0e10cSrcweir } // namespace ary
191