Wrapper for message buffers of grid DataHandles that allows for sending different types of data.
More...
template<typename Buffer>
class Dune::PDELab::PolymorphicBufferWrapper< Buffer >
Wrapper for message buffers of grid DataHandles that allows for sending different types of data.
The standard message buffers passed to the callbacks of the grid DataHandles are templated on a specific data type and do not support writing data of other types.
This wrapper takes a MessageBuffer for char and allows you to write any kind of POD data into it. It works by simply interpreting the data as a byte stream and serializing / deserializing it. Be aware that this implementation may create problems on heterogeneous architectures with different byte orderings.
- Warning
- The underlying MessageBuffer must use char as its data type, otherwise you will probably get compile or runtime errors!