1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #include <precomp.h>
29 #include <ary/idl/i_interface.hxx>
30 
31 
32 // NOT FULLY DECLARED SERVICES
33 #include <cosv/tpl/processor.hxx>
34 #include <ary/idl/ik_interface.hxx>
35 #include <ary/doc/d_oldidldocu.hxx>
36 #include <sci_impl.hxx>
37 #include "i2s_calculator.hxx"
38 
39 
40 namespace ary
41 {
42 namespace idl
43 {
44 
45 
46 class Interface_2s
47 {
48 };
49 
50 
51 Interface::Interface( const String &      i_sName,
52                       Ce_id               i_nOwner )
53     :   sName(i_sName),
54         nOwner(i_nOwner),
55         aBases(),
56         aFunctions(),
57         aAttributes(),
58         p2s()
59 {
60 }
61 
62 Interface::~Interface()
63 {
64     for ( RelationList::iterator it = aBases.begin();
65           it != aBases.end();
66           ++it )
67     {
68         delete (*it).Info();
69     }
70 }
71 
72 void
73 Interface::do_Accept( csv::ProcessorIfc & io_processor ) const
74 {
75     csv::CheckedCall(io_processor, *this);
76 }
77 
78 ClassId
79 Interface::get_AryClass() const
80 {
81     return class_id;
82 }
83 
84 const String &
85 Interface::inq_LocalName() const
86 {
87     return sName;
88 }
89 
90 Ce_id
91 Interface::inq_NameRoom() const
92 {
93     return nOwner;
94 }
95 
96 Ce_id
97 Interface::inq_Owner() const
98 {
99     return nOwner;
100 }
101 
102 E_SightLevel
103 Interface::inq_SightLevel() const
104 {
105     return sl_File;
106 }
107 
108 
109 namespace ifc_interface
110 {
111 
112 inline const Interface &
113 interface_cast( const CodeEntity &  i_ce )
114 {
115     csv_assert( i_ce.AryClass() == Interface::class_id );
116     return static_cast< const Interface& >(i_ce);
117 }
118 
119 void
120 attr::Get_Bases( Dyn_StdConstIterator<CommentedRelation> &     o_result,
121                  const CodeEntity &                             i_ce )
122 {
123     o_result = new SCI_Vector<CommentedRelation>(interface_cast(i_ce).aBases);
124 }
125 
126 void
127 attr::Get_Functions( Dyn_CeIterator &    o_result,
128                      const CodeEntity &  i_ce )
129 {
130     o_result = new SCI_Vector<Ce_id>(interface_cast(i_ce).aFunctions);
131 }
132 
133 void
134 attr::Get_Attributes( Dyn_CeIterator &    o_result,
135                       const CodeEntity &  i_ce )
136 {
137     o_result = new SCI_Vector<Ce_id>(interface_cast(i_ce).aAttributes);
138 }
139 
140 void
141 xref::Get_Derivations( Dyn_CeIterator &    o_result,
142                         const CodeEntity &  i_ce )
143 {
144     o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_Derivations));
145 }
146 
147 void
148 xref::Get_SynonymTypedefs( Dyn_CeIterator &    o_result,
149                            const CodeEntity &  i_ce )
150 {
151     o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_SynonymTypedefs));
152 }
153 
154 void
155 xref::Get_ExportingServices( Dyn_CeIterator &    o_result,
156                              const CodeEntity &  i_ce )
157 {
158     o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_ExportingServices));
159 }
160 
161 void
162 xref::Get_ExportingSingletons( Dyn_CeIterator &    o_result,
163 							   const CodeEntity &  i_ce )
164 {
165     o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_ExportingSingletons));
166 }
167 
168 void
169 xref::Get_AsReturns( Dyn_CeIterator &    o_result,
170                      const CodeEntity &  i_ce )
171 {
172     o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_AsReturns));
173 }
174 
175 void
176 xref::Get_AsParameters( Dyn_CeIterator &    o_result,
177                         const CodeEntity &  i_ce )
178 {
179     o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_AsParameters));
180 }
181 
182 void
183 xref::Get_AsDataTypes( Dyn_CeIterator &    o_result,
184                        const CodeEntity &  i_ce )
185 {
186     o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_AsDataTypes));
187 }
188 
189 
190 
191 
192 }   // namespace ifc_interface
193 
194 
195 }   //  namespace   idl
196 }   //  namespace   ary
197