1e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// -*- C++ -*- 2e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh 3e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc. 4e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// 5e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// This file is part of the GNU ISO C++ Library. This library is free 6e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// software; you can redistribute it and/or modify it under the terms 7e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// of the GNU General Public License as published by the Free Software 8e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// Foundation; either version 3, or (at your option) any later 9e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// version. 10e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh 11e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// This library is distributed in the hope that it will be useful, but 12e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// WITHOUT ANY WARRANTY; without even the implied warranty of 13e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// General Public License for more details. 15e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh 16e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// Under Section 7 of GPL version 3, you are granted additional 17e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// permissions described in the GCC Runtime Library Exception, version 18e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// 3.1, as published by the Free Software Foundation. 19e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh 20e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// You should have received a copy of the GNU General Public License and 21e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// a copy of the GCC Runtime Library Exception along with this program; 22e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 23e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// <http://www.gnu.org/licenses/>. 24e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh 25e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL. 26e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh 27e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// Permission to use, copy, modify, sell, and distribute this software 28e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// is hereby granted without fee, provided that the above copyright 29e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// notice appears in all copies, and that both that copyright notice 30e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// and this permission notice appear in supporting documentation. None 31e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// of the above authors, nor IBM Haifa Research Laboratories, make any 32e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// representation about the suitability of this software for any 33e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// purpose. It is provided "as is" without express or implied 34e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh// warranty. 35e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh 36e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh/** 37e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh * @file iterators_fn_imps.hpp 38e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh * Contains implementations of cc_ht_map_'s iterators related functions, e.g., 39e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh * begin(). 40e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh */ 41e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh 42e7de7d971409d955ca138406d5062499bc554451Andrew HsiehPB_DS_CLASS_T_DEC 43e7de7d971409d955ca138406d5062499bc554451Andrew Hsiehtypename PB_DS_CLASS_C_DEC::iterator 44e7de7d971409d955ca138406d5062499bc554451Andrew HsiehPB_DS_CLASS_C_DEC::s_end_it; 45e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh 46e7de7d971409d955ca138406d5062499bc554451Andrew HsiehPB_DS_CLASS_T_DEC 47e7de7d971409d955ca138406d5062499bc554451Andrew Hsiehtypename PB_DS_CLASS_C_DEC::const_iterator 48e7de7d971409d955ca138406d5062499bc554451Andrew HsiehPB_DS_CLASS_C_DEC::s_const_end_it; 49e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh 50e7de7d971409d955ca138406d5062499bc554451Andrew HsiehPB_DS_CLASS_T_DEC 51e7de7d971409d955ca138406d5062499bc554451Andrew Hsiehinline typename PB_DS_CLASS_C_DEC::iterator 52e7de7d971409d955ca138406d5062499bc554451Andrew HsiehPB_DS_CLASS_C_DEC:: 53e7de7d971409d955ca138406d5062499bc554451Andrew Hsiehbegin() 54e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh{ 55e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh pointer p_value; 56e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh std::pair<entry_pointer, size_type> pos; 57e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh get_start_it_state(p_value, pos); 58e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh return iterator(p_value, pos, this); 59e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh} 60e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh 61e7de7d971409d955ca138406d5062499bc554451Andrew HsiehPB_DS_CLASS_T_DEC 62e7de7d971409d955ca138406d5062499bc554451Andrew Hsiehinline typename PB_DS_CLASS_C_DEC::iterator 63e7de7d971409d955ca138406d5062499bc554451Andrew HsiehPB_DS_CLASS_C_DEC:: 64e7de7d971409d955ca138406d5062499bc554451Andrew Hsiehend() 65e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh{ return s_end_it; } 66e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh 67e7de7d971409d955ca138406d5062499bc554451Andrew HsiehPB_DS_CLASS_T_DEC 68e7de7d971409d955ca138406d5062499bc554451Andrew Hsiehinline typename PB_DS_CLASS_C_DEC::const_iterator 69e7de7d971409d955ca138406d5062499bc554451Andrew HsiehPB_DS_CLASS_C_DEC:: 70e7de7d971409d955ca138406d5062499bc554451Andrew Hsiehbegin() const 71e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh{ 72e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh pointer p_value; 73e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh std::pair<entry_pointer, size_type> pos; 74e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh get_start_it_state(p_value, pos); 75e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh return const_iterator(p_value, pos, this); 76e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh} 77e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh 78e7de7d971409d955ca138406d5062499bc554451Andrew HsiehPB_DS_CLASS_T_DEC 79e7de7d971409d955ca138406d5062499bc554451Andrew Hsiehinline typename PB_DS_CLASS_C_DEC::const_iterator 80e7de7d971409d955ca138406d5062499bc554451Andrew HsiehPB_DS_CLASS_C_DEC:: 81e7de7d971409d955ca138406d5062499bc554451Andrew Hsiehend() const 82e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh{ return s_const_end_it; } 83e7de7d971409d955ca138406d5062499bc554451Andrew Hsieh 84