#include #include template PoolEntry::PoolEntry( T* initValue, uint8_t set_length, uint8_t set_valid ) : length(set_length), valid(set_valid) { this->address = new T[this->length]; if (initValue != NULL) { memcpy(this->address, initValue, this->getByteSize() ); } else { memset(this->address, 0, this->getByteSize() ); } } //As the data pool is global, this dtor is only be called on program exit. //Warning! Never copy pool entries! template PoolEntry::~PoolEntry() { delete[] this->address; } template uint16_t PoolEntry::getByteSize() { return ( sizeof(T) * this->length ); } template uint8_t PoolEntry::getSize() { return this->length; } template void* PoolEntry::getRawData() { return this->address; } template void PoolEntry::setValid( uint8_t isValid ) { this->valid = isValid; } template uint8_t PoolEntry::getValid() { return valid; } template void PoolEntry::print() { for (uint8_t size = 0; size < this->length; size++ ) { debug << "| " << std::hex << (double)this->address[size] << (this->valid? " (valid) " : " (invalid) "); } debug << std::dec << std::endl; } template Type PoolEntry::getType() { return PodTypeConversion::type; } template class PoolEntry; template class PoolEntry; template class PoolEntry; template class PoolEntry; template class PoolEntry; template class PoolEntry; template class PoolEntry; template class PoolEntry;