5#ifndef DUNE_GRID_COMMON_DATAHANDLEIF_HH
6#define DUNE_GRID_COMMON_DATAHANDLEIF_HH
14#include <dune/common/bartonnackmanifcheck.hh>
31 template <
class MessageBufferImp>
34 MessageBufferImp & buff_;
76 template <
class DataHandleImp,
class DataTypeImp>
96 CHECK_INTERFACE_IMPLEMENTATION((asImp().
contains(dim,codim)));
97 return asImp().contains(dim,codim);
109 CHECK_INTERFACE_IMPLEMENTATION((asImp().
fixedSize(dim, codim)));
110 return asImp().fixedSize(dim, codim);
117 template<
class EntityType>
118 size_t size (
const EntityType& e)
const
120 CHECK_INTERFACE_IMPLEMENTATION((asImp().
size(e)));
121 return asImp().size(e);
128 template<
class MessageBufferImp,
class EntityType>
129 void gather (MessageBufferImp& buff,
const EntityType& e)
const
132 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().
gather(buffIF,e)));
142 template<
class MessageBufferImp,
class EntityType>
143 void scatter (MessageBufferImp& buff,
const EntityType& e,
size_t n)
146 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().
scatter(buffIF,e,n)));
151 DataHandleImp& asImp () {
return static_cast<DataHandleImp &
> (*this);}
153 const DataHandleImp& asImp ()
const
155 return static_cast<const DataHandleImp &
>(*this);
159#undef CHECK_INTERFACE_IMPLEMENTATION
160#undef CHECK_AND_CALL_INTERFACE_IMPLEMENTATION
Include standard header files.
Definition agrid.hh:60
Communication message buffer interface. This class describes the interface for reading and writing da...
Definition datahandleif.hh:33
MessageBufferIF(MessageBufferImp &buff)
stores reference to original buffer buff
Definition datahandleif.hh:37
void write(const T &val)
just wraps the call of the internal buffer method write which writes the data of type T from the buff...
Definition datahandleif.hh:45
void read(T &val)
just wraps the call of the internal buffer method read which reads the data of type T from the buffer...
Definition datahandleif.hh:59
CommDataHandleIF describes the features of a data handle for communication in parallel runs using the...
Definition datahandleif.hh:78
CommDataHandleIF()
Definition datahandleif.hh:86
void scatter(MessageBufferImp &buff, const EntityType &e, size_t n)
unpack data from message buffer to user.
Definition datahandleif.hh:143
bool contains(int dim, int codim) const
returns true if data for given valid codim should be communicated
Definition datahandleif.hh:94
size_t size(const EntityType &e) const
how many objects of type DataType have to be sent for a given entity
Definition datahandleif.hh:118
void gather(MessageBufferImp &buff, const EntityType &e) const
pack data from user to message buffer
Definition datahandleif.hh:129
bool fixedSize(int dim, int codim) const
returns true if size of data per entity of given dim and codim is a constant
Definition datahandleif.hh:107
DataTypeImp DataType
data type of data to communicate
Definition datahandleif.hh:82