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_traits.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_TRAITS_HXX
32 #define ARY_CPP_C_TRAITS_HXX
39 #include <ary/cpp/c_types4cpp.hxx>
47 template <class X
> class Node
;
60 /** Basic traits for derived ones of ->CodeEntity.
64 typedef CodeEntity entity_base_type
;
65 typedef Ce_id id_type
;
67 static entity_base_type
&
73 /** An instance of SYMBOL_TRAITS for ->::ary::SortedIds<>.
75 @see ::ary::SortedIds<>
77 struct CeNode_Traits
: public Ce_Traits
79 static const symtree::Node
<CeNode_Traits
> *
81 const entity_base_type
&
83 static symtree::Node
<CeNode_Traits
> *
85 entity_base_type
& i_entity
);
86 static entity_base_type
*
88 const entity_base_type
&
91 static id_type
Search_(
92 const entity_base_type
&
94 const KEY
& i_localKey
);
98 /** An instance of COMPARE for ->::ary::SortedIds<>.
100 @see ::ary::SortedIds<>
102 struct Ce_Compare
: public Ce_Traits
104 typedef String key_type
;
106 static const key_type
&
108 const entity_base_type
&
111 const key_type
& i_1
,
112 const key_type
& i_2
);
115 /** An instance of COMPARE for ->::ary::SortedIds<>.
117 @see ::ary::SortedIds<>
119 struct Ce_GlobalCompare
: public Ce_Traits
121 typedef entity_base_type key_type
;
123 static const key_type
&
125 const entity_base_type
&
129 const key_type
& i_1
,
130 const key_type
& i_2
);
134 /** Basic traits for derivd ones of ->DefineEntity.
138 typedef DefineEntity entity_base_type
;
139 typedef De_id id_type
;
141 static entity_base_type
&
147 /** An instance of COMPARE for ->::ary::SortedIds<>.
149 @see ::ary::SortedIds<>
151 struct Def_Compare
: public Def_Traits
153 typedef String key_type
;
155 static const key_type
&
157 const entity_base_type
&
160 const key_type
& i_1
,
161 const key_type
& i_2
);
164 /** Basic traits for derivd ones of ->Type.
168 typedef Type entity_base_type
;
169 typedef Type_id id_type
;
171 static entity_base_type
&
176 /** An instance of COMPARE for ->::ary::SortedIds<>.
178 @see ::ary::SortedIds<>
180 struct UsedType_Compare
: public Type_Traits
182 typedef UsedType key_type
;
184 static const key_type
&
186 const entity_base_type
&
189 const key_type
& i_1
,
190 const key_type
& i_2
);
200 /// Implementation helper for ->CeNode_Traits::Search_ .
202 const CodeEntity
& i_entity
,
203 const String
& i_localKey
);
208 CeNode_Traits::Search_( const entity_base_type
& i_entity
,
209 const KEY
& i_localKey
)
211 return CeNode_Search(i_entity
, i_localKey
);