1
0
forked from fsfw/fsfw

new ctor and bugfixes

This commit is contained in:
2020-05-12 17:57:37 +02:00
parent d873fcbf8e
commit 291710f257
4 changed files with 40 additions and 22 deletions

View File

@ -3,6 +3,12 @@
ConstStorageAccessor::ConstStorageAccessor(store_address_t storeId):
storeId(storeId) {}
ConstStorageAccessor::ConstStorageAccessor(store_address_t storeId,
StorageManagerIF* store):
storeId(storeId), store(store) {
internalState = AccessState::ASSIGNED;
}
ConstStorageAccessor::~ConstStorageAccessor() {
if(deleteData and store != nullptr) {
sif::debug << "deleting store data" << std::endl;
@ -27,6 +33,11 @@ StorageAccessor::StorageAccessor(store_address_t storeId):
ConstStorageAccessor(storeId) {
}
StorageAccessor::StorageAccessor(store_address_t storeId,
StorageManagerIF* store):
ConstStorageAccessor(storeId, store) {
}
StorageAccessor& StorageAccessor::operator =(
StorageAccessor&& other) {
// Call the parent move assignment and also assign own member.
@ -97,7 +108,7 @@ void ConstStorageAccessor::print() const {
}
void ConstStorageAccessor::assignStore(StorageManagerIF* store) {
internalState = AccessState::READ;
internalState = AccessState::ASSIGNED;
this->store = store;
}