Update package 2 #22
@ -8,9 +8,9 @@
|
|||||||
/**
|
/**
|
||||||
* @brief Helper class to read data sets or pool variables
|
* @brief Helper class to read data sets or pool variables
|
||||||
*/
|
*/
|
||||||
class PoolReadHelper {
|
class PoolReadGuard {
|
||||||
public:
|
public:
|
||||||
PoolReadHelper(ReadCommitIF* readObject,
|
PoolReadGuard(ReadCommitIF* readObject,
|
||||||
MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING,
|
MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING,
|
||||||
uint32_t mutexTimeout = 20):
|
uint32_t mutexTimeout = 20):
|
||||||
readObject(readObject), mutexTimeout(mutexTimeout) {
|
readObject(readObject), mutexTimeout(mutexTimeout) {
|
||||||
@ -42,7 +42,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief Default destructor which will take care of commiting changed values.
|
* @brief Default destructor which will take care of commiting changed values.
|
||||||
*/
|
*/
|
||||||
~PoolReadHelper() {
|
~PoolReadGuard() {
|
||||||
if(readObject != nullptr and not noCommit) {
|
if(readObject != nullptr and not noCommit) {
|
||||||
readObject->commit(timeoutType, mutexTimeout);
|
readObject->commit(timeoutType, mutexTimeout);
|
||||||
}
|
}
|
@ -192,7 +192,7 @@ public:
|
|||||||
resetSubscriptionList();
|
resetSubscriptionList();
|
||||||
ReturnValue_t status = HasReturnvaluesIF::RETURN_OK;
|
ReturnValue_t status = HasReturnvaluesIF::RETURN_OK;
|
||||||
{
|
{
|
||||||
PoolReadHelper readHelper(&dataset);
|
PoolReadGuard readHelper(&dataset);
|
||||||
if(readHelper.getReadResult() != HasReturnvaluesIF::RETURN_OK) {
|
if(readHelper.getReadResult() != HasReturnvaluesIF::RETURN_OK) {
|
||||||
status = readHelper.getReadResult();
|
status = readHelper.getReadResult();
|
||||||
}
|
}
|
||||||
@ -205,7 +205,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
PoolReadHelper readHelper(&testUint32);
|
PoolReadGuard readHelper(&testUint32);
|
||||||
if(readHelper.getReadResult() != HasReturnvaluesIF::RETURN_OK) {
|
if(readHelper.getReadResult() != HasReturnvaluesIF::RETURN_OK) {
|
||||||
status = readHelper.getReadResult();
|
status = readHelper.getReadResult();
|
||||||
}
|
}
|
||||||
@ -214,7 +214,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
PoolReadHelper readHelper(&testInt64Vec);
|
PoolReadGuard readHelper(&testInt64Vec);
|
||||||
if(readHelper.getReadResult() != HasReturnvaluesIF::RETURN_OK) {
|
if(readHelper.getReadResult() != HasReturnvaluesIF::RETURN_OK) {
|
||||||
status = readHelper.getReadResult();
|
status = readHelper.getReadResult();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user