1
0
forked from fsfw/fsfw

ADDED old pool entry constructor

This commit is contained in:
2020-01-26 18:31:17 +01:00
parent 6eedb3f097
commit d9fa13b6eb
2 changed files with 12 additions and 0 deletions

View File

@ -12,6 +12,17 @@ PoolEntry<T>::PoolEntry(std::initializer_list<T> initValue, uint8_t set_length,
}
}
template <typename T>
PoolEntry<T>::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 <typename T>