1 #ifndef DUNE_POLYGONGRID_ENTITYSEED_HH 2 #define DUNE_POLYGONGRID_ENTITYSEED_HH 3 4 #include <cstddef> 5 6 #include <limits> 7 #include <type_traits> 8 9 #include <dune/grid/common/entityseed.hh> 10 11 namespace Dune 12 { 13 14 namespace __PolygonGrid 15 { 16 17 // EntitySeed 18 // ---------- 19 20 template< class Index, int codim > 21 class EntitySeed 22 { 23 typedef EntitySeed< Index, codim > This; 24 25 public: 26 static const int codimension = codim; 27 28 EntitySeed () = default; EntitySeed(const Index & index)29 explicit EntitySeed ( const Index &index ) : index_( index ) {} 30 isValid() const31 bool isValid () const noexcept { return static_cast< bool >( index() ); } 32 operator ==(const This & other) const33 bool operator== ( const This &other ) const noexcept { return (index() == other.index()); } operator !=(const This & other) const34 bool operator!= ( const This &other ) const noexcept { return (index() != other.index()); } 35 index() const36 Index index () const noexcept { return index_; } 37 38 private: 39 Index index_; 40 }; 41 42 } // namespace __PolygonGrid 43 44 } // namespace Dune 45 46 #endif // #ifndef DUNE_POLYGONGRID_ENTITYSEED_HH 47