1169691Skan// -*- C++ -*-
2169691Skan
3169691Skan// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
4169691Skan//
5169691Skan// This file is part of the GNU ISO C++ Library.  This library is free
6169691Skan// software; you can redistribute it and/or modify it under the terms
7169691Skan// of the GNU General Public License as published by the Free Software
8169691Skan// Foundation; either version 2, or (at your option) any later
9169691Skan// version.
10169691Skan
11169691Skan// This library is distributed in the hope that it will be useful, but
12169691Skan// WITHOUT ANY WARRANTY; without even the implied warranty of
13169691Skan// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14169691Skan// General Public License for more details.
15169691Skan
16169691Skan// You should have received a copy of the GNU General Public License
17169691Skan// along with this library; see the file COPYING.  If not, write to
18169691Skan// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
19169691Skan// MA 02111-1307, USA.
20169691Skan
21169691Skan// As a special exception, you may use this file as part of a free
22169691Skan// software library without restriction.  Specifically, if other files
23169691Skan// instantiate templates or use macros or inline functions from this
24169691Skan// file, or you compile this file and link it with other files to
25169691Skan// produce an executable, this file does not by itself cause the
26169691Skan// resulting executable to be covered by the GNU General Public
27169691Skan// License.  This exception does not however invalidate any other
28169691Skan// reasons why the executable file might be covered by the GNU General
29169691Skan// Public License.
30169691Skan
31169691Skan// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
32169691Skan
33169691Skan// Permission to use, copy, modify, sell, and distribute this software
34169691Skan// is hereby granted without fee, provided that the above copyright
35169691Skan// notice appears in all copies, and that both that copyright notice
36169691Skan// and this permission notice appear in supporting documentation. None
37169691Skan// of the above authors, nor IBM Haifa Research Laboratories, make any
38169691Skan// representation about the suitability of this software for any
39169691Skan// purpose. It is provided "as is" without express or implied
40169691Skan// warranty.
41169691Skan
42169691Skan/**
43169691Skan * @file traits.hpp
44169691Skan * Contains an implementation class for ov_tree_.
45169691Skan */
46169691Skan
47169691Skan#ifndef PB_DS_OV_TREE_NODE_AND_IT_TRAITS_HPP
48169691Skan#define PB_DS_OV_TREE_NODE_AND_IT_TRAITS_HPP
49169691Skan
50169691Skan#include <ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp>
51169691Skan
52169691Skannamespace pb_ds
53169691Skan{
54169691Skan  namespace detail
55169691Skan  {
56169691Skan
57169691Skan    template<typename Key,
58169691Skan	     typename Mapped,
59169691Skan	     class Cmp_Fn,
60169691Skan	     template<typename Const_Node_Iterator,
61169691Skan		      class Node_Iterator,
62169691Skan		      class Cmp_Fn_,
63169691Skan		      class Allocator_>
64169691Skan    class Node_Update,
65169691Skan	     class Allocator>
66169691Skan    struct tree_traits<
67169691Skan      Key,
68169691Skan      Mapped,
69169691Skan      Cmp_Fn,
70169691Skan      Node_Update,
71169691Skan      ov_tree_tag,
72169691Skan      Allocator>
73169691Skan    {
74169691Skan    private:
75169691Skan      typedef
76169691Skan      typename types_traits<
77169691Skan      Key,
78169691Skan      Mapped,
79169691Skan      Allocator,
80169691Skan      false>::value_type
81169691Skan      value_type;
82169691Skan
83169691Skan    public:
84169691Skan      typedef
85169691Skan      typename tree_node_metadata_selector<
86169691Skan      Key,
87169691Skan      Mapped,
88169691Skan      Cmp_Fn,
89169691Skan      Node_Update,
90169691Skan      Allocator>::type
91169691Skan      metadata_type;
92169691Skan
93169691Skan      typedef
94169691Skan      ov_tree_node_const_it_<
95169691Skan	value_type,
96169691Skan	metadata_type,
97169691Skan	Allocator>
98169691Skan      const_node_iterator;
99169691Skan
100169691Skan      typedef
101169691Skan      ov_tree_node_it_<
102169691Skan	value_type,
103169691Skan	metadata_type,
104169691Skan	Allocator>
105169691Skan      node_iterator;
106169691Skan
107169691Skan      typedef
108169691Skan      Node_Update<
109169691Skan	const_node_iterator,
110169691Skan	node_iterator,
111169691Skan	Cmp_Fn,
112169691Skan	Allocator>
113169691Skan      node_update;
114169691Skan
115169691Skan      typedef
116169691Skan      pb_ds::null_tree_node_update<
117169691Skan	const_node_iterator,
118169691Skan	node_iterator,
119169691Skan	Cmp_Fn,
120169691Skan	Allocator>*
121169691Skan      null_node_update_pointer;
122169691Skan    };
123169691Skan
124169691Skan    template<typename Key,
125169691Skan	     class Cmp_Fn,
126169691Skan	     template<typename Const_Node_Iterator,
127169691Skan		      class Node_Iterator,
128169691Skan		      class Cmp_Fn_,
129169691Skan		      class Allocator_>
130169691Skan    class Node_Update,
131169691Skan	     class Allocator>
132169691Skan    struct tree_traits<
133169691Skan      Key,
134169691Skan      null_mapped_type,
135169691Skan      Cmp_Fn,
136169691Skan      Node_Update,
137169691Skan      ov_tree_tag,
138169691Skan      Allocator>
139169691Skan    {
140169691Skan    private:
141169691Skan      typedef
142169691Skan      typename types_traits<
143169691Skan      Key,
144169691Skan      null_mapped_type,
145169691Skan      Allocator,
146169691Skan      false>::value_type
147169691Skan      value_type;
148169691Skan
149169691Skan    public:
150169691Skan      typedef
151169691Skan      typename tree_node_metadata_selector<
152169691Skan      Key,
153169691Skan      null_mapped_type,
154169691Skan      Cmp_Fn,
155169691Skan      Node_Update,
156169691Skan      Allocator>::type
157169691Skan      metadata_type;
158169691Skan
159169691Skan      typedef
160169691Skan      ov_tree_node_const_it_<
161169691Skan	value_type,
162169691Skan	metadata_type,
163169691Skan	Allocator>
164169691Skan      const_node_iterator;
165169691Skan
166169691Skan      typedef const_node_iterator node_iterator;
167169691Skan
168169691Skan      typedef
169169691Skan      Node_Update<
170169691Skan	const_node_iterator,
171169691Skan	const_node_iterator,
172169691Skan	Cmp_Fn,
173169691Skan	Allocator>
174169691Skan      node_update;
175169691Skan
176169691Skan      typedef
177169691Skan      pb_ds::null_tree_node_update<
178169691Skan	const_node_iterator,
179169691Skan	node_iterator,
180169691Skan	Cmp_Fn,
181169691Skan	Allocator>*
182169691Skan      null_node_update_pointer;
183169691Skan    };
184169691Skan
185169691Skan  } // namespace detail
186169691Skan} // namespace pb_ds
187169691Skan
188169691Skan#endif // #ifndef PB_DS_OV_TREE_NODE_AND_IT_TRAITS_HPP
189169691Skan
190