3 #ifndef DUNE_DATAHANDLEIF_HH 4 #define DUNE_DATAHANDLEIF_HH 12 #include <dune/common/bartonnackmanifcheck.hh> 29 template <
class MessageBufferImp>
32 MessageBufferImp & buff_;
71 template <
class DataHandleImp,
class DataTypeImp>
90 CHECK_INTERFACE_IMPLEMENTATION((asImp().contains(dim,codim)));
91 return asImp().contains(dim,codim);
101 CHECK_INTERFACE_IMPLEMENTATION((asImp().fixedsize(dim,codim)));
102 return asImp().fixedsize(dim,codim);
109 template<
class EntityType>
110 size_t size (
const EntityType& e)
const 112 CHECK_INTERFACE_IMPLEMENTATION((asImp().size(e)));
113 return asImp().size(e);
120 template<
class MessageBufferImp,
class EntityType>
121 void gather (MessageBufferImp& buff,
const EntityType& e)
const 124 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().gather(buffIF,e)));
132 template<
class MessageBufferImp,
class EntityType>
133 void scatter (MessageBufferImp& buff,
const EntityType& e,
size_t n)
136 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().scatter(buffIF,e,n)));
141 DataHandleImp& asImp () {
return static_cast<DataHandleImp &
> (*this);}
143 const DataHandleImp& asImp ()
const 145 return static_cast<const DataHandleImp &
>(*this);
149 #undef CHECK_INTERFACE_IMPLEMENTATION 150 #undef CHECK_AND_CALL_INTERFACE_IMPLEMENTATION Communication message buffer interface. This class describes the interface for reading and writing da...
Definition: datahandleif.hh:30
MessageBufferIF(MessageBufferImp &buff)
stores reference to original buffer buff
Definition: datahandleif.hh:35
size_t size(const EntityType &e) const
how many objects of type DataType have to be sent for a given entity
Definition: datahandleif.hh:110
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:54
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:43
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:99
CommDataHandleIF describes the features of a data handle for communication in parallel runs using the...
Definition: datahandleif.hh:72
void gather(MessageBufferImp &buff, const EntityType &e) const
pack data from user to message buffer
Definition: datahandleif.hh:121
DataTypeImp DataType
data type of data to communicate
Definition: datahandleif.hh:76
bool contains(int dim, int codim) const
returns true if data for given valid codim should be communicated
Definition: datahandleif.hh:88
void scatter(MessageBufferImp &buff, const EntityType &e, size_t n)
unpack data from message buffer to user.
Definition: datahandleif.hh:133
Include standard header files.
Definition: agrid.hh:59
CommDataHandleIF()
Definition: datahandleif.hh:80