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_class.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_CLASS_HXX
32 #define ARY_CPP_C_CLASS_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/sequentialids.hxx>
44 #include <ary/cpp/c_types4cpp.hxx>
45 #include <ary/cpp/c_slntry.hxx>
68 class Class
: public CodeEntity
,
72 enum E_ClassId
{ class_id
= 1001 };
81 SLOT_StaticOperations
,
88 typedef ::ary::symtree::Node
<CeNode_Traits
> node_t
;
93 const String
& i_sLocalName
,
95 E_Protection i_eProtection
,
97 E_ClassKey i_eClassKey
);
102 const S_Classes_Base
&
104 void Add_TemplateParameterType(
105 const String
& i_sLocalName
,
106 Type_id i_nIdAsType
);
107 void Add_KnownDerivative(
109 { aKnownDerivatives
.Add(i_nId
); }
112 const String
& i_sLocalName
,
115 const String
& i_sLocalName
,
117 void Add_LocalTypedef(
118 const String
& i_sLocalName
,
120 void Add_LocalOperation(
121 const String
& i_sLocalName
,
123 void Add_LocalStaticOperation(
124 const String
& i_sLocalName
,
127 const String
& i_sLocalName
,
129 void Add_LocalStaticData(
130 const String
& i_sLocalName
,
133 void UpdateVirtuality(
134 E_Virtuality i_eVirtuality
)
135 { if ( int(i_eVirtuality
) > int(eVirtuality
) )
136 eVirtuality
= i_eVirtuality
; }
137 const List_TplParam
&
138 TemplateParameters() const
139 { return aTemplateParameterTypes
; }
140 const List_Bases
& BaseClasses() const { return aBaseClasses
; }
141 const SequentialIds
<Ce_id
> &
142 KnownDerivatives() const
143 { return aKnownDerivatives
; }
146 E_ClassKey
ClassKey() const;
147 E_Protection
Protection() const;
148 E_Virtuality
Virtuality() const { return eVirtuality
; }
151 const String
& i_key
) const;
152 Rid
Search_LocalClass(
153 const String
& i_sName
) const;
154 const node_t
& AsNode() const;
162 // Interface csv::ConstProcessorClient
163 virtual void do_Accept(
164 csv::ProcessorIfc
& io_processor
) const;
166 // Interface ary::cpp::CodeEntity
167 virtual const String
&
168 inq_LocalName() const;
169 virtual Cid
inq_Owner() const;
170 virtual loc::Le_id
inq_Location() const;
172 // Interface ary::cpp::CppEntity
173 virtual ClassId
get_AryClass() const;
175 // Interface ary::AryGroup
176 virtual Gid
inq_Id_Group() const;
177 virtual const cpp::CppEntity
&
178 inq_RE_Group() const;
179 virtual const group::SlotList
&
181 virtual DYN Slot
* inq_Create_Slot(
182 SlotAccessId i_nSlot
) const;
184 typedef List_LocalCe::const_iterator CIterator_Locals
;
185 typedef List_LocalCe::iterator Iterator_Locals
;
186 typedef SequentialIds
<Ce_id
> IdSequence
;
188 CIterator_Locals
PosOfName(
189 const List_LocalCe
& i_rList
,
190 const String
& i_sName
) const;
192 CeEssentials aEssentials
;
193 node_t aAssignedNode
;
195 List_Bases aBaseClasses
;
196 List_TplParam aTemplateParameterTypes
;
198 List_LocalCe aClasses
;
200 List_LocalCe aTypedefs
;
201 List_LocalCe aOperations
;
202 List_LocalCe aStaticOperations
;
204 List_LocalCe aStaticData
;
206 IdSequence aFriendClasses
;
207 IdSequence aFriendOperations
;
208 IdSequence aKnownDerivatives
;
210 E_ClassKey eClassKey
;
211 E_Protection eProtection
;
212 E_Virtuality eVirtuality
;
220 Class::ClassKey() const
226 Class::Protection() const
231 inline const Class::node_t
&
232 Class::AsNode() const
234 return aAssignedNode
;
237 inline Class::node_t
&
240 return aAssignedNode
;