libvisiontransfer
10.8.0
|
A (thread-local) parameter transaction lock for queued writes. [C++11]
Obtain a lock using transactionLock() if you want to set several, possibly dependent, parameters in one go. You can't go wrong by using this for any parameter setting operation. This ensures coordinated setting and uniform calculation of dependent parameters. All parameter write operations (setParameter etc.) are transparently queued until the TransactionLock object leaves scope, and then written as a batch in its destructor. The actually caused update operations are asynchronous. You can use commitAndWait() to explicitly wait synchronously for all direct dependencies.
Definition at line 1334 of file deviceparameters.h.
#include <visiontransfer/deviceparameters.h>
Public Member Functions | |
TransactionLock (Pimpl *pimpl) | |
void | commitAndWait (int maxWaitMilliseconds=1000) |
Send and commit the batch transaction and wait for direct(*) parameter dependencies to be reported as settled by the device. More... | |
void visiontransfer::DeviceParameters::TransactionLock::commitAndWait | ( | int | maxWaitMilliseconds = 1000 | ) |
Send and commit the batch transaction and wait for direct(*) parameter dependencies to be reported as settled by the device.
After a successful call, the ParameterSet will contain up-to-date metadata and values for all directly(*) affected parameters.
Throws an exception if the remote operation signaled failure or the selected wait interval for a reply is exceeded.
The TransactionLock object is no longer operational after this call, and no subsequent parameter operations should be initiated inside its scope.
If you do not call this function, the batch transaction will be completed asynchronously when the TransactionLock leaves scope.
(*) Please note that some parameters may be affected by post-hoc constraints even after the transaction proper is complete, in particular parameters that can only be resolved after an internal or peripheral image sensor reset. You should use setParameterUpdateCallback() to always be informed of the current device parameters in real time.
Definition at line 222 of file deviceparameters.cpp.