Bump for 3.6-28
[LibreOffice.git] / autodoc / source / ary / idl / i_module.cxx
bloba8459b3ebfddb1fae55b0bd77dcd5358a09e2323
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #include <precomp.h>
30 #include <ary/idl/i_module.hxx>
31 #include <ary/idl/ik_module.hxx>
33 // NOT FULLY DECLARED SERVICES
34 #include <cosv/tpl/processor.hxx>
35 #include <ary/idl/i_gate.hxx>
36 #include <ary/idl/i_module.hxx>
37 #include <ary/idl/i_service.hxx>
38 #include <ary/idl/i_interface.hxx>
39 #include <ary/idl/i_struct.hxx>
40 #include <ary/idl/i_exception.hxx>
41 #include <ary/idl/i_enum.hxx>
42 #include <ary/idl/i_typedef.hxx>
43 #include <ary/idl/i_constgroup.hxx>
44 #include <ary/idl/i_singleton.hxx>
45 #include <ary/idl/i_siservice.hxx>
46 #include <ary/idl/i_sisingleton.hxx>
47 #include <ary/idl/ip_ce.hxx>
48 #include <nametreenode.hxx>
51 namespace ary
53 namespace idl
56 Module::Module()
57 : pImpl( new NameTreeNode<Ce_id> )
61 Module::Module( const String & i_sName,
62 const Module & i_rParent )
63 : pImpl( new NameTreeNode<Ce_id>( i_sName,
64 *i_rParent.pImpl,
65 i_rParent.CeId() ) )
69 Module::~Module()
73 void
74 Module::Add_Name( const String & i_sName,
75 Ce_id i_nCodeEntity )
77 pImpl->Add_Name(i_sName, i_nCodeEntity);
80 Ce_id
81 Module::Search_Name( const String & i_sName ) const
83 return pImpl->Search_Name(i_sName);
86 void
87 Module::Get_Names( Dyn_StdConstIterator<Ce_id> & o_rResult ) const
89 pImpl->Get_Names( o_rResult );
92 void
93 Module::do_Accept( csv::ProcessorIfc & io_processor ) const
95 csv::CheckedCall(io_processor, *this);
98 ClassId
99 Module::get_AryClass() const
101 return class_id;
104 const String &
105 Module::inq_LocalName() const
107 return pImpl->Name();
110 Ce_id
111 Module::inq_NameRoom() const
113 return pImpl->Parent();
116 Ce_id
117 Module::inq_Owner() const
119 return pImpl->Parent();
122 E_SightLevel
123 Module::inq_SightLevel() const
125 return sl_Module;
129 namespace ifc_module
132 inline const Module &
133 module_cast( const CodeEntity & i_ce )
135 csv_assert( i_ce.AryClass() == Module::class_id );
136 return static_cast< const Module& >(i_ce);
139 typedef NameTreeNode<Ce_id>::Map_LocalNames NameMap;
141 void
142 attr::Get_AllChildrenSeparated( std::vector< const CodeEntity* > & o_nestedModules,
143 std::vector< const CodeEntity* > & o_services,
144 std::vector< const CodeEntity* > & o_interfaces,
145 std::vector< const CodeEntity* > & o_structs,
146 std::vector< const CodeEntity* > & o_exceptions,
147 std::vector< const CodeEntity* > & o_enums,
148 std::vector< const CodeEntity* > & o_typedefs,
149 std::vector< const CodeEntity* > & o_constantGroups,
150 std::vector< const CodeEntity* > & o_singletons,
151 const CePilot & i_pilot,
152 const CodeEntity & i_ce )
154 const CodeEntity *
155 pCe = 0;
156 NameMap::const_iterator
157 itEnd = module_cast(i_ce).pImpl->LocalNames().end();
158 for ( NameMap::const_iterator
159 it = module_cast(i_ce).pImpl->LocalNames().begin();
160 it != itEnd;
161 ++it )
163 pCe = &i_pilot.Find_Ce( (*it).second );
164 switch (pCe->AryClass())
166 case Module::class_id:
167 o_nestedModules.push_back(pCe);
168 break;
169 case SglIfcService::class_id:
170 case Service::class_id:
171 o_services.push_back(pCe);
172 break;
173 case Interface::class_id:
174 o_interfaces.push_back(pCe);
175 break;
176 case Struct::class_id:
177 o_structs.push_back(pCe);
178 break;
179 case Exception::class_id:
180 o_exceptions.push_back(pCe);
181 break;
182 case Enum::class_id:
183 o_enums.push_back(pCe);
184 break;
185 case Typedef::class_id:
186 o_typedefs.push_back(pCe);
187 break;
188 case ConstantsGroup::class_id:
189 o_constantGroups.push_back(pCe);
190 break;
191 case SglIfcSingleton::class_id:
192 case Singleton::class_id:
193 o_singletons.push_back(pCe);
194 break;
196 } // end for
200 } // namespace ifc_module
204 } // namespace idl
205 } // namespace ary
207 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */