Beatmup
|
Simply a piece of binary data of a specific size. More...
#include <chunkfile.h>
Public Member Functions | |
Chunk () | |
Makes an empty chunk. More... | |
Chunk (size_t size) | |
Allocates a chunk of a given size. More... | |
Chunk (ChunkCollection &collection, const std::string &id) | |
Reads a chunk from a collection. More... | |
~Chunk () | |
Chunk (Chunk &&chunk) | |
Chunk & | operator= (Chunk &&chunk) |
void | writeTo (ChunkFileWriter &file, const std::string &id) const |
Writes a chunk out to a file. More... | |
size_t | size () const |
void * | operator() () |
const void * | operator() () const |
operator bool () const | |
template<typename datatype > | |
datatype * | ptr (size_t offset=0) |
template<typename datatype > | |
const datatype * | ptr (size_t offset=0) const |
template<typename datatype > | |
datatype | at (size_t offset) const |
template<typename datatype > | |
datatype & | at (size_t offset) |
Private Attributes | |
size_t | chunkSize |
void * | data |
Simply a piece of binary data of a specific size.
A brick in ChunkCollection-based data sets. No information is stored on the nature of the data: it is up to the application to interpret the chunk content.
Definition at line 210 of file chunkfile.h.
|
inline |
Chunk::Chunk | ( | size_t | size | ) |
Allocates a chunk of a given size.
[in] | size | Chunk size in bytes |
Definition at line 153 of file chunkfile.cpp.
Chunk::Chunk | ( | ChunkCollection & | collection, |
const std::string & | id | ||
) |
Reads a chunk from a collection.
[in] | collection | The collection to read from |
[in] | id | The chunk id to find in the collection |
Definition at line 158 of file chunkfile.cpp.
Chunk::~Chunk | ( | ) |
Definition at line 173 of file chunkfile.cpp.
|
inline |
Definition at line 235 of file chunkfile.h.
void Chunk::writeTo | ( | ChunkFileWriter & | file, |
const std::string & | id | ||
) | const |
Writes a chunk out to a file.
[in] | file | The file to write to |
[in] | id | The chunk id |
Definition at line 168 of file chunkfile.cpp.
|
inline |
Definition at line 257 of file chunkfile.h.
|
inline |
Definition at line 259 of file chunkfile.h.
|
inline |
Definition at line 260 of file chunkfile.h.
|
inline |
Definition at line 262 of file chunkfile.h.
|
inline |
Definition at line 264 of file chunkfile.h.
|
inline |
Definition at line 267 of file chunkfile.h.
|
inline |
Definition at line 271 of file chunkfile.h.
|
inline |
Definition at line 275 of file chunkfile.h.
|
private |
Definition at line 212 of file chunkfile.h.
|
private |
Definition at line 213 of file chunkfile.h.