libstdc++
left_child_next_sibling_heap_/node.hpp
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 // Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
00004 //
00005 // This file is part of the GNU ISO C++ Library.  This library is free
00006 // software; you can redistribute it and/or modify it under the terms
00007 // of the GNU General Public License as published by the Free Software
00008 // Foundation; either version 3, or (at your option) any later
00009 // version.
00010 
00011 // This library is distributed in the hope that it will be useful, but
00012 // WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // General Public License for more details.
00015 
00016 // Under Section 7 of GPL version 3, you are granted additional
00017 // permissions described in the GCC Runtime Library Exception, version
00018 // 3.1, as published by the Free Software Foundation.
00019 
00020 // You should have received a copy of the GNU General Public License and
00021 // a copy of the GCC Runtime Library Exception along with this program;
00022 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
00023 // <http://www.gnu.org/licenses/>.
00024 
00025 // Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
00026 
00027 // Permission to use, copy, modify, sell, and distribute this software
00028 // is hereby granted without fee, provided that the above copyright
00029 // notice appears in all copies, and that both that copyright notice
00030 // and this permission notice appear in supporting documentation. None
00031 // of the above authors, nor IBM Haifa Research Laboratories, make any
00032 // representation about the suitability of this software for any
00033 // purpose. It is provided "as is" without express or implied
00034 // warranty.
00035 
00036 /**
00037  * @file left_child_next_sibling_heap_/node.hpp
00038  * Contains an implementation struct for this type of heap's node.
00039  */
00040 
00041 #ifndef PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_NODE_HPP
00042 #define PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_NODE_HPP
00043 
00044 namespace __gnu_pbds
00045 {
00046   namespace detail
00047   {
00048     /// Node.
00049     template<typename _Value, typename _Metadata, typename _Alloc>
00050     struct left_child_next_sibling_heap_node_
00051     {
00052     private:
00053       typedef left_child_next_sibling_heap_node_<_Value, _Metadata, _Alloc> this_type;
00054 
00055     public:
00056       typedef _Value                value_type;
00057       typedef typename _Alloc::size_type    size_type;
00058       typedef _Metadata             metadata_type;
00059 
00060       typedef typename _Alloc::template rebind<this_type>::other::pointer node_pointer;
00061 
00062       value_type    m_value;
00063       metadata_type     m_metadata;
00064       node_pointer  m_p_l_child;
00065       node_pointer  m_p_next_sibling;
00066       node_pointer  m_p_prev_or_parent;
00067     };
00068 
00069     template<typename _Value, typename _Alloc>
00070     struct left_child_next_sibling_heap_node_<_Value, null_type, _Alloc>
00071     {
00072     private:
00073       typedef left_child_next_sibling_heap_node_<_Value, null_type, _Alloc> this_type;
00074 
00075     public:
00076       typedef _Value                value_type;
00077       typedef typename _Alloc::size_type    size_type;
00078 
00079       typedef typename _Alloc::template rebind<this_type>::other::pointer node_pointer;
00080 
00081       value_type    m_value;
00082       node_pointer  m_p_l_child;
00083       node_pointer  m_p_next_sibling;
00084       node_pointer  m_p_prev_or_parent;
00085     };
00086 
00087   } // namespace detail
00088 } // namespace __gnu_pbds
00089 
00090 #endif // #ifndef PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_NODE_HPP