debug_fn_imps.hpp revision 256281
143989Snsouch// -*- C++ -*-
243999Snsouch
343989Snsouch// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
443989Snsouch//
543999Snsouch// This file is part of the GNU ISO C++ Library.  This library is free
643999Snsouch// software; you can redistribute it and/or modify it under the terms
743999Snsouch// of the GNU General Public License as published by the Free Software
843999Snsouch// Foundation; either version 2, or (at your option) any later
943999Snsouch// version.
1043999Snsouch
1143989Snsouch// This library is distributed in the hope that it will be useful, but
1243989Snsouch// WITHOUT ANY WARRANTY; without even the implied warranty of
1343989Snsouch// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1443989Snsouch// General Public License for more details.
1543989Snsouch
1643989Snsouch// You should have received a copy of the GNU General Public License
1743989Snsouch// along with this library; see the file COPYING.  If not, write to
1843989Snsouch// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
1943989Snsouch// MA 02111-1307, USA.
2043989Snsouch
2143989Snsouch// As a special exception, you may use this file as part of a free
2243989Snsouch// software library without restriction.  Specifically, if other files
2343989Snsouch// instantiate templates or use macros or inline functions from this
2443989Snsouch// file, or you compile this file and link it with other files to
2543989Snsouch// produce an executable, this file does not by itself cause the
2643989Snsouch// resulting executable to be covered by the GNU General Public
2743989Snsouch// License.  This exception does not however invalidate any other
2843989Snsouch// reasons why the executable file might be covered by the GNU General
2943989Snsouch// Public License.
3043989Snsouch
3143989Snsouch// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
3243989Snsouch
3343989Snsouch// Permission to use, copy, modify, sell, and distribute this software
3443989Snsouch// is hereby granted without fee, provided that the above copyright
3543989Snsouch// notice appears in all copies, and that both that copyright notice
3643989Snsouch// and this permission notice appear in supporting documentation. None
3743999Snsouch// of the above authors, nor IBM Haifa Research Laboratories, make any
3843989Snsouch// representation about the suitability of this software for any
3943989Snsouch// purpose. It is provided "as is" without express or implied
4043999Snsouch// warranty.
4143999Snsouch
4243999Snsouch/**
4343999Snsouch * @file debug_fn_imps.hpp
4443999Snsouch * Contains implementations of cc_ht_map_'s debug-mode functions.
4543999Snsouch */
4643999Snsouch
4743999Snsouch#ifdef _GLIBCXX_DEBUG
4843999Snsouch
4943999SnsouchPB_DS_CLASS_T_DEC
5043999Snsouchvoid
5143999SnsouchPB_DS_CLASS_C_DEC::
5243999Snsouchassert_valid() const
5343989Snsouch{
5443989Snsouch  map_debug_base::check_size(m_num_used_e);
5543989Snsouch  assert_entry_pointer_array_valid(m_entries);
5643989Snsouch}
5743989Snsouch
5843989SnsouchPB_DS_CLASS_T_DEC
5943989Snsouchvoid
6043989SnsouchPB_DS_CLASS_C_DEC::
6143989Snsouchassert_entry_pointer_array_valid(const entry_pointer_array a_p_entries) const
6243989Snsouch{
6343989Snsouch  size_type iterated_num_used_e = 0;
6443989Snsouch  for (size_type pos = 0; pos < m_num_e; ++pos)
6543989Snsouch    {
66      entry_pointer p_e = a_p_entries[pos];
67      while (p_e != NULL)
68        {
69	  ++iterated_num_used_e;
70	  assert_entry_pointer_valid(p_e, traits_base::m_store_hash_indicator);
71	  p_e = p_e->m_p_next;
72        }
73    }
74  _GLIBCXX_DEBUG_ASSERT(iterated_num_used_e == m_num_used_e);
75}
76
77#include <ext/pb_ds/detail/cc_hash_table_map_/debug_store_hash_fn_imps.hpp>
78#include <ext/pb_ds/detail/cc_hash_table_map_/debug_no_store_hash_fn_imps.hpp>
79
80#endif
81