This file is indexed.

/usr/include/dune/grid/utility/persistentcontainer.hh is in libdune-grid-dev 2.5.1-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_PERSISTENTCONTAINER_HH
#define DUNE_PERSISTENTCONTAINER_HH

#include <map>

#include <dune/grid/utility/persistentcontainermap.hh>

namespace Dune
{

  /** \brief A class for storing data during an adaptation cycle.
   *
   * \copydetails PersistentContainerInterface
   */
  template< class G, class T >
  class PersistentContainer
    : public PersistentContainerMap< G, typename G::LocalIdSet, std::map< typename G::LocalIdSet::IdType, T > >
  {
    typedef PersistentContainerMap< G, typename G::LocalIdSet, std::map< typename G::LocalIdSet::IdType, T > > Base;

  public:
    typedef typename Base::Grid Grid;
    typedef typename Base::Value Value;

    PersistentContainer ( const Grid &grid, int codim, const Value &value = Value() )
      : Base( grid, codim, grid.localIdSet(), value )
    {}
  };

  /** \brief refer PersistentContainer<const Grid> to the implementation of the mutable grid */
  template< class Grid, class T >
  class PersistentContainer< const Grid, T >
    : public PersistentContainer< Grid, T >
  {
    typedef PersistentContainer< Grid, T > Base;
  public:
    typedef typename Base::Value Value;

    PersistentContainer ( const typename Base::Grid &grid, int codim, const Value &value = Value() )
      : Base(grid, codim, value)
    {}
  };

} // namespace Dune


#if 0

// the following implementation can be used for a grid providing a hash for the id type

#include <unordered_map>

namespace Dune
{

  template< G, class T >
  class PersistentContainer
    : public PersistentContainerMap< G, typename G::LocalIdSet, std::unordered_map< typename G::LocalIdSet::IdType, T > >
  {
    typedef PersistentContainerMap< G, typename G::LocalIdSet, std::unordered_map< typename G::LocalIdSet::IdType, T > > Base;

  public:
    typedef typename Base::Grid Grid;
    typedef typename Base::Value Value;

    PersistentContainer ( const Grid &grid, int codim, const Value &value )
      : Base( grid, codim, grid.localIdSet(), value )
    {}
  };

} // namespace Dune

#endif // #if 0

namespace std
{

  template< class G, class T >
  inline void swap ( Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T > &b )
  {
    a.swap( b );
  }

} // namespace std

#endif // #ifndef DUNE_PERSISTENTCONTAINER_HH