Flip Reference

 

DocumentValidator Template Class Reference

Namespace

ohm::flip

Declared in

ohm/flip/DocumentValidator.h

See Also

ohm::flip::DocumentServer

ohm::flip::ValidationReportWriter

Overview

The DocumentValidator template class is a pure virtual template class. Implementing it allows a server to logically validate the model on each client transaction.

The client will derive a class from it, using the root flip class as the template parameter.

Partial Class Diagram

Methods Overview

To Implement

Methods

validate

Implementing this method will let the derived class validate the model and implicitely the transaction that changed the model. T denotes the root flip class of the model.

virtual void   validate (ValidationReportWriter & report, archi::Int32 user_id, T & root) = 0;

Validation parsing is done in the same way than writing an observer. When an error is encountered a ValidationReportWriter method is called and the transaction will be refused. See ValidationReportWriter on how to report an error.

WARNING:Validation is server code.