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 ************************************************************************/
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>
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
,
74 Module::Add_Name( const String
& i_sName
,
77 pImpl
->Add_Name(i_sName
, i_nCodeEntity
);
81 Module::Search_Name( const String
& i_sName
) const
83 return pImpl
->Search_Name(i_sName
);
87 Module::Get_Names( Dyn_StdConstIterator
<Ce_id
> & o_rResult
) const
89 pImpl
->Get_Names( o_rResult
);
93 Module::do_Accept( csv::ProcessorIfc
& io_processor
) const
95 csv::CheckedCall(io_processor
, *this);
99 Module::get_AryClass() const
105 Module::inq_LocalName() const
107 return pImpl
->Name();
111 Module::inq_NameRoom() const
113 return pImpl
->Parent();
117 Module::inq_Owner() const
119 return pImpl
->Parent();
123 Module::inq_SightLevel() const
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
;
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
)
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();
163 pCe
= &i_pilot
.Find_Ce( (*it
).second
);
164 switch (pCe
->AryClass())
166 case Module::class_id
:
167 o_nestedModules
.push_back(pCe
);
169 case SglIfcService::class_id
:
170 case Service::class_id
:
171 o_services
.push_back(pCe
);
173 case Interface::class_id
:
174 o_interfaces
.push_back(pCe
);
176 case Struct::class_id
:
177 o_structs
.push_back(pCe
);
179 case Exception::class_id
:
180 o_exceptions
.push_back(pCe
);
183 o_enums
.push_back(pCe
);
185 case Typedef::class_id
:
186 o_typedefs
.push_back(pCe
);
188 case ConstantsGroup::class_id
:
189 o_constantGroups
.push_back(pCe
);
191 case SglIfcSingleton::class_id
:
192 case Singleton::class_id
:
193 o_singletons
.push_back(pCe
);
200 } // namespace ifc_module
207 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */