Zserio C++ runtime library  1.2.0
Built for Zserio 2.16.0
IValidationObserver.h
Go to the documentation of this file.
1 #ifndef ZSERIO_I_VALIDATION_OBSERVER_H_INC
2 #define ZSERIO_I_VALIDATION_OBSERVER_H_INC
3 
4 #include "zserio/Span.h"
5 #include "zserio/StringView.h"
6 #include "zserio/Types.h"
7 
8 namespace zserio
9 {
10 
15 {
16 public:
17  virtual ~IValidationObserver() = default;
18 
24  virtual void beginDatabase(size_t numberOfTables) = 0;
25 
31  virtual void endDatabase(size_t numberOfValidatedTables) = 0;
32 
41  virtual bool beginTable(StringView tableName, size_t numberOfRows) = 0;
42 
51  virtual bool endTable(StringView tableName, size_t numberOfValidatedRows) = 0;
52 
56  enum ErrorType
57  {
62 
67 
72 
77 
82 
87 
92 
97  };
98 
110  virtual bool reportError(StringView tableName, StringView fieldName,
111  Span<const StringView> primaryKeyValues, ErrorType errorType, StringView message) = 0;
112 };
113 
114 } // namespace zserio
115 
116 #endif // ZSERIO_I_VALIDATION_OBSERVER_H_INC
virtual bool beginTable(StringView tableName, size_t numberOfRows)=0
virtual void beginDatabase(size_t numberOfTables)=0
virtual ~IValidationObserver()=default
virtual void endDatabase(size_t numberOfValidatedTables)=0
virtual bool endTable(StringView tableName, size_t numberOfValidatedRows)=0
virtual bool reportError(StringView tableName, StringView fieldName, Span< const StringView > primaryKeyValues, ErrorType errorType, StringView message)=0