CoDiPack  2.2.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
codi::ByteDataView Struct Reference

#include <byteDataView.hpp>

Public Member Functions

 ByteDataView ()=default
 Empty initialization. Innit needs to be called on this object.
 
 ByteDataView (char *pointer, size_t pos, size_t end)
 Constructor.
 
size_t getPosition ()
 Get the current data position.
 
void init (char *pointer, size_t pos, size_t end)
 Initialize the object.
 
template<typename T >
read ()
 Read a single object of type T.
 
template<typename T >
T * read (size_t size)
 Read an array of length size of types T.
 
template<typename T >
T * reserve (size_t size)
 Reserve memory for an array of type T with length size. The returned pointer can be written with the actual data.
 
template<typename T >
T * write (T const &data)
 Write a single entry of type T.
 
template<typename T >
T * write (T const *data, size_t size)
 Write an array of type T with length size.
 

Detailed Description

Helper for reading and writing to a byte array.

Returned pointers are always pointers into the byte array. Every read, write, and reserve function advances the internal position in the byte array by the size of the data. It is always assumed that enough space is left in the byte array.


The documentation for this struct was generated from the following file: