Home | History | Annotate | Download | only in rb_tree_map_
      1 // -*- C++ -*-
      2 
      3 // Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
      4 //
      5 // This file is part of the GNU ISO C++ Library.  This library is free
      6 // software; you can redistribute it and/or modify it under the terms
      7 // of the GNU General Public License as published by the Free Software
      8 // Foundation; either version 3, or (at your option) any later
      9 // version.
     10 
     11 // This library is distributed in the hope that it will be useful, but
     12 // WITHOUT ANY WARRANTY; without even the implied warranty of
     13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     14 // General Public License for more details.
     15 
     16 // Under Section 7 of GPL version 3, you are granted additional
     17 // permissions described in the GCC Runtime Library Exception, version
     18 // 3.1, as published by the Free Software Foundation.
     19 
     20 // You should have received a copy of the GNU General Public License and
     21 // a copy of the GCC Runtime Library Exception along with this program;
     22 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
     23 // <http://www.gnu.org/licenses/>.
     24 
     25 // Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
     26 
     27 // Permission to use, copy, modify, sell, and distribute this software
     28 // is hereby granted without fee, provided that the above copyright
     29 // notice appears in all copies, and that both that copyright notice
     30 // and this permission notice appear in supporting documentation. None
     31 // of the above authors, nor IBM Haifa Research Laboratories, make any
     32 // representation about the suitability of this software for any
     33 // purpose. It is provided "as is" without express or implied
     34 // warranty.
     35 
     36 /**
     37  * @file traits.hpp
     38  * Contains an implementation for rb_tree_.
     39  */
     40 
     41 #ifndef PB_DS_RB_TREE_NODE_AND_IT_TRAITS_HPP
     42 #define PB_DS_RB_TREE_NODE_AND_IT_TRAITS_HPP
     43 
     44 #include <ext/pb_ds/detail/rb_tree_map_/node.hpp>
     45 
     46 namespace __gnu_pbds
     47 {
     48   namespace detail
     49   {
     50     template<typename Key,
     51 	     typename Mapped,
     52 	     typename Cmp_Fn,
     53 	     template<typename Const_Node_Iterator,
     54 		      class Node_Iterator,
     55 		      class Cmp_Fn_,
     56 		      class Allocator_>
     57     class Node_Update,
     58 	     typename Allocator>
     59     struct tree_traits<
     60       Key,
     61       Mapped,
     62       Cmp_Fn,
     63       Node_Update,
     64       rb_tree_tag,
     65       Allocator> : public bin_search_tree_traits<
     66       Key,
     67       Mapped,
     68       Cmp_Fn,
     69       Node_Update,
     70       rb_tree_node_<
     71       typename types_traits<
     72       Key,
     73       Mapped,
     74       Allocator,
     75       false>::value_type,
     76       typename tree_node_metadata_selector<
     77       Key,
     78       Mapped,
     79       Cmp_Fn,
     80       Node_Update,
     81       Allocator>::type,
     82       Allocator>,
     83       Allocator>
     84     { };
     85 
     86     template<typename Key,
     87 	     class Cmp_Fn,
     88 	     template<typename Const_Node_Iterator,
     89 		      class Node_Iterator,
     90 		      class Cmp_Fn_,
     91 		      class Allocator_>
     92     class Node_Update,
     93 	     class Allocator>
     94     struct tree_traits<
     95       Key,
     96       null_mapped_type,
     97       Cmp_Fn,
     98       Node_Update,
     99       rb_tree_tag,
    100       Allocator> : public bin_search_tree_traits<
    101       Key,
    102       null_mapped_type,
    103       Cmp_Fn,
    104       Node_Update,
    105       rb_tree_node_<
    106       typename types_traits<
    107       Key,
    108       null_mapped_type,
    109       Allocator,
    110       false>::value_type,
    111       typename tree_node_metadata_selector<
    112       Key,
    113       null_mapped_type,
    114       Cmp_Fn,
    115       Node_Update,
    116       Allocator>::type,
    117       Allocator>,
    118       Allocator>
    119     { };
    120 
    121   } // namespace detail
    122 } // namespace __gnu_pbds
    123 
    124 #endif
    125