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: traits_impl.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_TRAITS_IMPL_HXX
32 #define ARY_TRAITS_IMPL_HXX
36 #include <ary/getncast.hxx>
45 /** Finds the node assigned to an entity, if that entity has a specific
49 The assumed actual type of io_node.
52 const typename
NODE::node_t
*
54 const typename
NODE::traits_t::entity_base_type
&
57 /** Finds the node assigned to an entity, if that entity has a specific
61 The assumed actual type of io_node.
64 typename
NODE::node_t
*
66 typename
NODE::traits_t::entity_base_type
&
69 /** Finds a child to a node.
71 template<class NODE
, class KEY
>
72 typename
NODE::traits_t::id_type
74 const typename
NODE::traits_t::entity_base_type
&
76 const KEY
& i_localKey
);
84 const typename
NODE::node_t
*
85 NodeOf(const typename
NODE::traits_t::entity_base_type
& io_node
)
88 pn
= ary_cast
<NODE
>(&io_node
);
90 return & pn
->AsNode();
95 typename
NODE::node_t
*
96 NodeOf(typename
NODE::traits_t::entity_base_type
& io_node
)
99 pn
= ary_cast
<NODE
>(&io_node
);
101 return & pn
->AsNode();
105 template<class NODE
, class KEY
>
106 typename
NODE::traits_t::id_type
107 Search_Child( const typename
NODE::traits_t::entity_base_type
& i_node
,
108 const KEY
& i_localKey
)
111 pn
= ary_cast
<NODE
>(&i_node
);
113 return pn
->Search_Child(i_localKey
);
114 return typename
NODE::traits_t::id_type(0);
120 } // namespace traits