/usr/include/dune/grid/utility/persistentcontainerwrapper.hh is in libdune-grid-dev 2.3.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 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_PERSISTENTCONTAINERWRAPPER_HH
#define DUNE_PERSISTENTCONTAINERWRAPPER_HH
#include <dune/grid/utility/hostgridaccess.hh>
#include <dune/grid/utility/persistentcontainer.hh>
namespace Dune
{
  // PersistentContainerWrapper
  // --------------------------
  template< class G, class T >
  class PersistentContainerWrapper
  {
    typedef PersistentContainerWrapper< G, T > This;
    typedef Dune::HostGridAccess< G > HostGridAccess;
    typedef typename HostGridAccess::HostGrid HostGrid;
    typedef PersistentContainer< HostGrid, T > PersistentContainerHostGrid;
  public:
    typedef G Grid;
    typedef typename PersistentContainer< HostGrid, T >::Value Value;
    typedef typename PersistentContainer< HostGrid, T >::Size Size;
    typedef typename PersistentContainer< HostGrid, T >::Iterator Iterator;
    typedef typename PersistentContainer< HostGrid, T >::ConstIterator ConstIterator;
    PersistentContainerWrapper ( const Grid &grid, int codim, const Value &value = Value() )
      : hostContainer_( HostGridAccess::hostGrid( grid ), codim, value )
    {}
    template< class Entity >
    const Value &operator[] ( const Entity &entity ) const
    {
      return hostContainer_[ HostGridAccess::hostEntity( entity ) ];
    }
    template< class Entity >
    Value &operator[] ( const Entity &entity )
    {
      return hostContainer_[ HostGridAccess::hostEntity( entity ) ];
    }
    template< class Entity >
    const Value &operator() ( const Entity &entity, int subEntity ) const
    {
      return hostContainer_( HostGridAccess::hostEntity( entity ), subEntity );
    }
    template< class Entity >
    Value &operator() ( const Entity &entity, int subEntity )
    {
      return hostContainer_( HostGridAccess::hostEntity( entity ), subEntity );
    }
    Size size () const { return hostContainer_.size(); }
    void resize ( const Value &value = Value() ) { hostContainer_.resize( value ); }
    void shrinkToFit () { return hostContainer_.shrinkToFit(); }
    void fill ( const Value &value = Value() ) { hostContainer_.fill( value ); }
    void swap ( This &other ) { hostContainer_.swap( other ); }
    ConstIterator begin () const { return hostContainer_.begin(); }
    Iterator begin () { return hostContainer_.begin(); }
    ConstIterator end () const { return hostContainer_.end(); }
    Iterator end () { return hostContainer_.end(); }
    int codimension () const { return hostContainer_.codimension(); }
    // deprecated stuff, will be removed after Dune 2.3
    typedef Grid GridType DUNE_DEPRECATED_MSG("Use Grid instead.");
    typedef Value Data DUNE_DEPRECATED_MSG("Use Value instead.");
    void reserve () DUNE_DEPRECATED_MSG("Use resize() instead.")
    { return resize(); }
    void clear () DUNE_DEPRECATED_MSG("Use resize() instead.")
    {
      resize( Value() );
      shrinkToFit();
      fill( Value() );
    }
    void update () DUNE_DEPRECATED_MSG("Use resize() instead.")
    {
      resize( Value() );
      shrinkToFit();
    }
  protected:
    PersistentContainer< HostGrid, T > hostContainer_;
  };
} // namespace Dune
#endif // #ifndef DUNE_PERSISTENTCONTAINERWRAPPER_HH
 |