IChangeValidator Class
(ServerIO::IChangeValidator)IChangeValidator may be used on each value change in channel. The Validate()-function decides if the new value is accepted or not. More...
Header: | #include <IO/ServerIO/IChangeValidator.h> |
Inherited By: |
Public Functions
virtual | ~IChangeValidator() |
virtual void | Equals() = 0 |
virtual void | NotEquals(double delta) = 0 |
virtual bool | Revert() |
void | Validate(T &newValue, const T &oldValue) |
Detailed Description
IChangeValidator may be used on each value change in channel. The Validate()-function decides if the new value is accepted or not.
Validators can be registered/unregistered by ICDPChannel::RegisterValidator()/ICDPChannel::UnregisterValidator().
See also IOServer, ServerIO, ServerIO::ICDPChannel, ServerIO::ChangeValidatorSupport, and ServerIO::DeltaValidatorSendTrigger.
Member Function Documentation
[virtual]
IChangeValidator::~IChangeValidator()
Destroys the instance of IChangeValidator. The destructor is virtual.
[pure virtual]
void IChangeValidator::Equals()
Equals is called on Change validation when given values equal
[pure virtual]
void IChangeValidator::NotEquals(double delta)
NotEquals is called on Change validation when given values don't equal
delta is difference between newValue and oldValue, represented as double value
[virtual]
bool IChangeValidator::Revert()
Revert is called after NotEquals on Change validation. When true is returned, the change is rejected, and newValue is assigned to oldValue.
void IChangeValidator::Validate(T &newValue, const T &oldValue)
Decides if the new value is accepted or not. Validate() is called by the value holder class that supports validators. Will call Equals() or NotEquals(), depending on difference between newValue and oldValue. If not equal, Revert() is called. If Revert() returns true, change is rejected, and newValue is assigned to oldValue.
newValue contains new value for evaluation.
oldValue contains previous accepted value.
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.