1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: c_namesp.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef ARY_CPP_C_NAMESP_HXX
32 #define ARY_CPP_C_NAMESP_HXX
38 #include <ary/cpp/c_ce.hxx>
39 #include <ary/arygroup.hxx>
41 #include <ary/symtreenode.hxx>
42 #include <ary/cessentl.hxx>
43 #include <ary/cpp/c_types4cpp.hxx>
44 #include <ary/cpp/c_slntry.hxx>
51 class OperationSignature
;
66 class Namespace
: public CodeEntity
,
70 enum E_ClassId
{ class_id
= 1000 };
74 SLOT_SubNamespaces
= 1,
83 typedef ::ary::symtree::Node
<CeNode_Traits
> node_t
;
87 const String
& i_sName
,
88 Namespace
& i_rParent
);
91 void Add_LocalNamespace(
92 Namespace
& io_rLocalNamespace
);
94 const String
& i_sLocalName
,
97 const String
& i_sLocalName
,
99 void Add_LocalTypedef(
100 const String
& i_sLocalName
,
102 void Add_LocalOperation(
103 const String
& i_sLocalName
,
105 void Add_LocalVariable(
106 const String
& i_sLocalName
,
108 void Add_LocalConstant(
109 const String
& i_sLocalName
,
113 virtual uintt
Depth() const;
114 Namespace
* Parent() const;
117 const String
& i_key
) const;
118 Namespace
* Search_LocalNamespace(
119 const String
& i_sLocalName
) const;
120 uintt
Get_SubNamespaces(
121 std::vector
< const Namespace
* > &
122 o_rResultList
) const;
123 Ce_id
Search_LocalClass(
124 const String
& i_sName
) const;
125 void Search_LocalOperations(
128 const String
& i_sName
) const;
129 const node_t
& AsNode() const;
135 NON_COPYABLE(Namespace
);
137 // Interface csv::ConstProcessorClient
138 virtual void do_Accept(
139 csv::ProcessorIfc
& io_processor
) const;
141 // Interface CodeEntity
142 virtual const String
&
143 inq_LocalName() const;
144 virtual Cid
inq_Owner() const;
145 virtual Lid
inq_Location() const;
147 // Interface ary::cpp::CppEntity
148 virtual ClassId
get_AryClass() const;
150 // Interface AryGroup
151 virtual Gid
inq_Id_Group() const;
152 virtual const cpp::CppEntity
&
153 inq_RE_Group() const;
154 virtual const ary::group::SlotList
&
156 virtual DYN Slot
* inq_Create_Slot(
157 SlotAccessId i_nSlot
) const;
159 typedef std::multimap
<String
, Ce_id
> Map_Operations
;
162 CeEssentials aEssentials
;
163 node_t aAssignedNode
;
165 Map_NamespacePtr aLocalNamespaces
;
166 Map_LocalCe aLocalClasses
;
167 Map_LocalCe aLocalEnums
;
168 Map_LocalCe aLocalTypedefs
;
169 Map_Operations aLocalOperations
;
170 Map_LocalCe aLocalVariables
;
171 Map_LocalCe aLocalConstants
;
180 inline const Namespace::node_t
&
181 Namespace::AsNode() const
183 return aAssignedNode
;
186 inline Namespace::node_t
&
189 return aAssignedNode
;