#ifndef TYPEBUFFER_H #define TYPEBUFFER_H #include "data/List.h" template class TypedBuffer { List data; public: TypedBuffer& add(const T& t) { data.add(t); return *this; } int getLength() const { return data.getLength(); } int getByteLength() const { return data.getLength() * static_cast(sizeof(T)); } operator const T*() const { return data.begin(); } void clear() { data.clear(); } }; #endif