f3de79d43a
2014-05-24 François Dumont <fdumont@gcc.gnu.org> * include/profile/array: Clean useless white chars. * include/profile/base.h: Likewise. * include/profile/iterator_tracker.h: Likewise. * include/profile/bitset: Code cleanup and remove not instrumented code. * include/profile/deque: Likewise. * include/profile/forward_list: Likewise. * include/profile/list (std::__profile::_List_profile<>): New. (std::__profile::list<>): Inherit from latter and adapt. * include/profile/impl/profiler_map_to_unordered_map.h: Generalize advise to match any ordered to unordered container conversion. * include/profile/ordered_base.h (std::__profile::_Ordered_profile<>): New. * include/Makefile.am: Add latter. * include/Makefile.in: Regenerate. * include/profile/map.h (std::__profile::map<>): Inherit from latter, remove not instrumented code. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h: Add some line feed. * include/profile/unordered_map: Clean useless white chars and replace spaces with tabs. * include/profile/unordered_set: Likewise. * include/profile/vector (std::__profile::_Vector_profile_pre<>): New. (std::__profile::_Vector_profile_post<>): New. (std::__profile::vector<>): Inherit from latter and adapt. From-SVN: r210900
66 lines
2.0 KiB
C++
66 lines
2.0 KiB
C++
// Profiling unordered containers implementation details -*- C++ -*-
|
|
|
|
// Copyright (C) 2014 Free Software Foundation, Inc.
|
|
//
|
|
// This file is part of the GNU ISO C++ Library. This library is free
|
|
// software; you can redistribute it and/or modify it under the
|
|
// terms of the GNU General Public License as published by the
|
|
// Free Software Foundation; either version 3, or (at your option)
|
|
// any later version.
|
|
//
|
|
// This library is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
|
|
// Under Section 7 of GPL version 3, you are granted additional
|
|
// permissions described in the GCC Runtime Library Exception, version
|
|
// 3.1, as published by the Free Software Foundation.
|
|
|
|
// You should have received a copy of the GNU General Public License along
|
|
// with this library; see the file COPYING3. If not see
|
|
// <http://www.gnu.org/licenses/>.
|
|
|
|
/** @file profile/ordered_base.h
|
|
* This file is a GNU profile extension to the Standard C++ Library.
|
|
*/
|
|
|
|
#ifndef _GLIBCXX_PROFILE_ORDERED
|
|
#define _GLIBCXX_PROFILE_ORDERED 1
|
|
|
|
namespace std _GLIBCXX_VISIBILITY(default)
|
|
{
|
|
namespace __profile
|
|
{
|
|
template<typename _Cont>
|
|
class _Ordered_profile
|
|
{
|
|
_Cont&
|
|
_M_conjure()
|
|
{ return *static_cast<_Cont*>(this); }
|
|
|
|
public:
|
|
_Ordered_profile() _GLIBCXX_NOEXCEPT
|
|
{ __profcxx_map_to_unordered_map_construct(&_M_conjure()); }
|
|
|
|
#if __cplusplus >= 201103L
|
|
_Ordered_profile(const _Ordered_profile&) noexcept
|
|
: _Ordered_profile() { }
|
|
_Ordered_profile(_Ordered_profile&&) noexcept
|
|
: _Ordered_profile() { }
|
|
|
|
_Ordered_profile&
|
|
operator=(const _Ordered_profile&) = default;
|
|
_Ordered_profile&
|
|
operator=(_Ordered_profile&&) = default;
|
|
#endif
|
|
|
|
~_Ordered_profile()
|
|
{ __profcxx_map_to_unordered_map_destruct(&_M_conjure()); }
|
|
};
|
|
|
|
} // namespace __profile
|
|
} // namespace std
|
|
|
|
#endif
|