• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
CDP Studio logo

CDP Studio

The no-code and full-code software development tool for distributed control systems and HMI

  • Why CDP
    • Software developers
    • Automation engineers
    • Managers
  • Product
    • Design UI
    • Develop
    • Analyze and test
    • Deploy
    • Framework and toolbox
    • Compatibility
  • Services
  • Use cases
  • Pricing
  • Try CDP

CDP Studio Documentation

  • Framework - CDP Core
  • IChangeValidator
  • 4.11.14

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:

ServerIO::DeltaValidatorSendTrigger

  • List of all members, including inherited members

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.

The content of this document is confidential information not to be published without the consent of CDP Technologies AS.

CDP Technologies AS, www.cdpstudio.com

Get started with CDP Studio today

Let us help you take your great ideas and turn them into the products your customer will love.

Try CDP Studio for free
Why CDP Studio?

CDP Technologies AS
Hundsværgata 8,
P.O. Box 144
6001 Ålesund, Norway

Tel: +47 990 80 900
E-mail: info@cdptech.com

Company

About CDP

Contact us

Services

Partners

Blog

Developers

Get started

User manuals

Support

Document download

Release notes

Follow CDP

  • LinkedIn
  • YouTube
  • GitHub

    © Copyright 2022 CDP Technologies. Privacy and cookie policy.

    Return to top