3 #ifndef DUNE_DATAHANDLEIF_HH
4 #define DUNE_DATAHANDLEIF_HH
12 #include <dune/common/bartonnackmanifcheck.hh>
31 template <
class MessageBufferImp>
34 MessageBufferImp & buff_;
73 template <
class DataHandleImp,
class DataTypeImp>
92 CHECK_INTERFACE_IMPLEMENTATION((asImp().
contains(dim,codim)));
93 return asImp().contains(dim,codim);
103 CHECK_INTERFACE_IMPLEMENTATION((asImp().
fixedsize(dim,codim)));
104 return asImp().fixedsize(dim,codim);
111 template<
class EntityType>
112 size_t size (
const EntityType& e)
const
114 CHECK_INTERFACE_IMPLEMENTATION((asImp().
size(e)));
115 return asImp().size(e);
122 template<
class MessageBufferImp,
class EntityType>
123 void gather (MessageBufferImp& buff,
const EntityType& e)
const
126 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().
gather(buffIF,e)));
134 template<
class MessageBufferImp,
class EntityType>
135 void scatter (MessageBufferImp& buff,
const EntityType& e,
size_t n)
138 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().
scatter(buffIF,e,n)));
143 DataHandleImp& asImp () {
return static_cast<DataHandleImp &
> (*this);}
145 const DataHandleImp& asImp ()
const
147 return static_cast<const DataHandleImp &
>(*this);
151 #undef CHECK_INTERFACE_IMPLEMENTATION
152 #undef CHECK_AND_CALL_INTERFACE_IMPLEMENTATION
CommDataHandleIF()
Definition: datahandleif.hh:82
void gather(MessageBufferImp &buff, const EntityType &e) const
pack data from user to message buffer
Definition: datahandleif.hh:123
DataTypeImp DataType
data type of data to communicate
Definition: datahandleif.hh:78
bool contains(int dim, int codim) const
returns true if data for given valid codim should be communicated
Definition: datahandleif.hh:90
CommDataHandleIF describes the features of a data handle for communication in parallel runs using the...
Definition: datahandleif.hh:74
Communication message buffer interface. This class describes the interface for reading and writing da...
Definition: datahandleif.hh:32
void read(T &val) const
just wraps the call of the internal buffer method read which reads the data of type T from the buffer...
Definition: datahandleif.hh:56
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
size_t size(const EntityType &e) const
how many objects of type DataType have to be sent for a given entity
Definition: datahandleif.hh:112
MessageBufferIF(MessageBufferImp &buff)
stores reference to original buffer buff
Definition: datahandleif.hh:37
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:101
void scatter(MessageBufferImp &buff, const EntityType &e, size_t n)
unpack data from message buffer to user.
Definition: datahandleif.hh:135