/usr/include/dune/grid/uggrid/uggridentitypointer.hh is in libdune-grid-dev 2.2.1-2.
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 | #ifndef DUNE_UGGRID_ENTITY_POINTER_HH
#define DUNE_UGGRID_ENTITY_POINTER_HH
namespace Dune {
/*! Acts as a pointer to an entities of a given codimension.
*/
template<int codim, class GridImp>
class UGGridEntityPointer
{
enum { dim = GridImp::dimension };
public:
//! export the type of the EntityPointer Implementation.
//! Necessary for the type conversion between Iterators and EntityPointer
typedef UGGridEntityPointer EntityPointerImp;
//! codimension of entity pointer
enum { codimension = codim };
typedef typename GridImp::template Codim<codim>::Entity Entity;
//! constructor
UGGridEntityPointer () {
virtualEntity_.setToTarget(nullptr,nullptr);
}
//! constructor
UGGridEntityPointer (typename UG_NS<dim>::template Entity<codim>::T* target, const GridImp* gridImp)
: virtualEntity_(target, gridImp)
{}
//! construct entity pointer from given entity
UGGridEntityPointer (const UGGridEntity<codim,dim,GridImp>& entity)
: virtualEntity_(entity.target_,entity.gridImp_)
{}
void setToTarget(typename UG_NS<dim>::template Entity<codim>::T* target, const GridImp* gridImp) {
virtualEntity_.setToTarget(target,gridImp);
}
typename UG_NS<dim>::template Entity<codim>::T* getTarget()
{
return virtualEntity_.getTarget();
}
const typename UG_NS<dim>::template Entity<codim>::T* getTarget() const
{
return virtualEntity_.getTarget();
}
//! equality
bool equals(const UGGridEntityPointer<codim,GridImp>& i) const {
return getTarget() == i.getTarget();
}
//! dereferencing
Entity& dereference() const {
return virtualEntity_;
}
//! ask for level of entity
int level () const {return virtualEntity_.level();}
protected:
mutable UGMakeableEntity<codim,dim,GridImp> virtualEntity_; //!< virtual entity
};
} // end namespace Dune
#endif
|