LCOV - code coverage report
Current view: top level - usr/include/boost/multi_index/detail - header_holder.hpp (source / functions) Hit Total Coverage
Test: ROSE Lines: 0 3 0.0 %
Date: 2022-12-08 13:48:47 Functions: 0 0 -
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* Copyright 2003-2008 Joaquin M Lopez Munoz.
       2             :  * Distributed under the Boost Software License, Version 1.0.
       3             :  * (See accompanying file LICENSE_1_0.txt or copy at
       4             :  * http://www.boost.org/LICENSE_1_0.txt)
       5             :  *
       6             :  * See http://www.boost.org/libs/multi_index for library home page.
       7             :  */
       8             : 
       9             : #ifndef BOOST_MULTI_INDEX_DETAIL_HEADER_HOLDER_HPP
      10             : #define BOOST_MULTI_INDEX_DETAIL_HEADER_HOLDER_HPP
      11             : 
      12             : #if defined(_MSC_VER)
      13             : #pragma once
      14             : #endif
      15             : 
      16             : #include <boost/noncopyable.hpp>
      17             : 
      18             : namespace boost{
      19             : 
      20             : namespace multi_index{
      21             : 
      22             : namespace detail{
      23             : 
      24             : /* A utility class used to hold a pointer to the header node.
      25             :  * The base from member idiom is used because index classes, which are
      26             :  * superclasses of multi_index_container, need this header in construction
      27             :  * time. The allocation is made by the allocator of the multi_index_container
      28             :  * class --hence, this allocator needs also be stored resorting
      29             :  * to the base from member trick.
      30             :  */
      31             : 
      32             : template<typename NodeTypePtr,typename Final>
      33             : struct header_holder:private noncopyable
      34             : {
      35           0 :   header_holder():member(final().allocate_node()){}
      36           0 :   ~header_holder(){final().deallocate_node(&*member);}
      37             : 
      38             :   NodeTypePtr member;
      39             : 
      40             : private:
      41           0 :   Final& final(){return *static_cast<Final*>(this);}
      42             : };
      43             : 
      44             : } /* namespace multi_index::detail */
      45             : 
      46             : } /* namespace multi_index */
      47             : 
      48             : } /* namespace boost */
      49             : 
      50             : #endif

Generated by: LCOV version 1.14