76 this->pointer = pointer;
86 T* convPointer = cast<T>();
87 pos +=
sizeof(T) * size;
104 T* convPointer = cast<T>();
105 pos +=
sizeof(T) * size;
115 return write(&data, 1);
121 T* convPointer = cast<T>();
122 for (
size_t i = 0; i < size; i += 1) {
123 convPointer[i] = data[i];
125 pos +=
sizeof(T) * size;
136 return reinterpret_cast<T*
>(&pointer[pos]);
#define CODI_INLINE
See codi::Config::ForcedInlines.
Definition config.h:457
#define codiAssert(x)
See codi::Config::EnableAssert.
Definition config.h:432
CoDiPack - Code Differentiation Package.
Definition codi.hpp:90
Definition byteDataView.hpp:51
T * reserve(size_t size)
Reserve memory for an array of type T with length size. The returned pointer can be written with the ...
Definition byteDataView.hpp:103
T * read(size_t size)
Read an array of length size of types T.
Definition byteDataView.hpp:85
T * write(T const &data)
Write a single entry of type T.
Definition byteDataView.hpp:114
T * write(T const *data, size_t size)
Write an array of type T with length size.
Definition byteDataView.hpp:120
ByteDataView(char *pointer, size_t pos, size_t end)
Constructor.
Definition byteDataView.hpp:65
size_t getPosition()
Get the current data position.
Definition byteDataView.hpp:70
T read()
Read a single object of type T.
Definition byteDataView.hpp:96
ByteDataView()=default
Empty initialization. Innit needs to be called on this object.
void init(char *pointer, size_t pos, size_t end)
Initialize the object.
Definition byteDataView.hpp:75