Memory

blob

Nameabmt::blob
Header#include <abmt/blob.h>

Attributes

char* data
size_t size

Methods

blob()
blob(void* ptr, size_t s)
blob sub_blob(size_t offset, size_t len=0)
void set_mem(const void* src, size_t len, size_t offset)
void get_mem(void* dst, size_t len, size_t offset)
T get(size_t offset)
void set(T& &obj, size_t offset)
T get2(size_t offset)Like get without size check.
void set2(T& &data, size_t offset)Like set without size check.
std::string str(size_t offset=0, size_t len=0)
~blob()[virtual]

Operators

bool operator==(blob& rhs)Compares only the pointer and the size. Not the content!
operator std::string()

blob_shared

Is derived from blob. So all blob functions can also be called.
Nameabmt::blob_shared
Header#include <abmt/blob.h>

Attributes

std::shared_ptr<char[]> shared_ptr

Methods

blob_shared(size_t s=0)
blob_shared(std::string s)copies s to the newly allocated buffer
blob_shared(blob& b)
blob_shared(const blob_shared& )=default
void realloc(size_t s=0)
void realloc(void* src_data_ptr_to_copy_from, size_t s)
void clear()
void reset(void* new_data_ptr=0, size_t s=0)resets the internal shared_ptr to new_data_ptr and takes over ownership

Operators

blob_shared operator+(blob b)
blob_shared& operator+=(blob b)

const_array < class T >

Nameabmt::const_array
Header#include <abmt/const_array.h>

Attributes

unsigned int length
T* array

Methods

const_array()=default
const_array(const_array& c)=delete
const_array(T(&ptr)[N])could mixup underling reference_counts
const_array(T* ptr, unsigned int len)
T* begin()
T* end()

Operators

T& operator[](unsigned int pos) const

...
Impressum