Pool Raw Access change bugfix
This commit is contained in:
parent
d9fa13b6eb
commit
85048cc9ee
@ -21,24 +21,13 @@ ReturnValue_t PoolRawAccess::read() {
|
|||||||
PoolEntryIF* read_out = ::dataPool.getRawData(dataPoolId);
|
PoolEntryIF* read_out = ::dataPool.getRawData(dataPoolId);
|
||||||
if (read_out != NULL) {
|
if (read_out != NULL) {
|
||||||
result = handleReadOut(read_out);
|
result = handleReadOut(read_out);
|
||||||
|
if(result == RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
result = READ_ENTRY_NON_EXISTENT;
|
result = READ_ENTRY_NON_EXISTENT;
|
||||||
}
|
}
|
||||||
error << "PoolRawAccess: read of DP Variable 0x" << std::hex << dataPoolId
|
handleReadError(result);
|
||||||
<< std::dec << " failed, ";
|
|
||||||
if(result == READ_TYPE_TOO_LARGE) {
|
|
||||||
error << "type too large." << std::endl;
|
|
||||||
}
|
|
||||||
else if(result == READ_INDEX_TOO_LARGE) {
|
|
||||||
error << "index too large." << std::endl;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
error << "entry does not exist." << std::endl;
|
|
||||||
}
|
|
||||||
valid = INVALID;
|
|
||||||
typeSize = 0;
|
|
||||||
sizeTillEnd = 0;
|
|
||||||
memset(value, 0, sizeof(value));
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,6 +54,24 @@ ReturnValue_t PoolRawAccess::handleReadOut(PoolEntryIF* read_out) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PoolRawAccess::handleReadError(ReturnValue_t result) {
|
||||||
|
error << "PoolRawAccess: read of DP Variable 0x" << std::hex << dataPoolId
|
||||||
|
<< std::dec << " failed, ";
|
||||||
|
if(result == READ_TYPE_TOO_LARGE) {
|
||||||
|
error << "type too large." << std::endl;
|
||||||
|
}
|
||||||
|
else if(result == READ_INDEX_TOO_LARGE) {
|
||||||
|
error << "index too large." << std::endl;
|
||||||
|
}
|
||||||
|
else if(result == READ_ENTRY_NON_EXISTENT) {
|
||||||
|
error << "entry does not exist." << std::endl;
|
||||||
|
}
|
||||||
|
valid = INVALID;
|
||||||
|
typeSize = 0;
|
||||||
|
sizeTillEnd = 0;
|
||||||
|
memset(value, 0, sizeof(value));
|
||||||
|
}
|
||||||
|
|
||||||
ReturnValue_t PoolRawAccess::commit() {
|
ReturnValue_t PoolRawAccess::commit() {
|
||||||
PoolEntryIF* write_back = ::dataPool.getRawData(dataPoolId);
|
PoolEntryIF* write_back = ::dataPool.getRawData(dataPoolId);
|
||||||
if ((write_back != NULL) && (readWriteMode != VAR_READ)) {
|
if ((write_back != NULL) && (readWriteMode != VAR_READ)) {
|
||||||
|
@ -157,6 +157,7 @@ protected:
|
|||||||
ReturnValue_t commit();
|
ReturnValue_t commit();
|
||||||
|
|
||||||
ReturnValue_t handleReadOut(PoolEntryIF* read_out);
|
ReturnValue_t handleReadOut(PoolEntryIF* read_out);
|
||||||
|
void handleReadError(ReturnValue_t result);
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
* \brief To access the correct data pool entry on read and commit calls, the data pool id
|
* \brief To access the correct data pool entry on read and commit calls, the data pool id
|
||||||
|
Loading…
Reference in New Issue
Block a user