Zserio C++17 runtime library  0.5.0
Built for Zserio 2.17.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 <string_view>
5 
6 #include "zserio/Span.h"
7 #include "zserio/Types.h"
8 
9 namespace zserio
10 {
11 
16 {
17 public:
18  virtual ~IValidationObserver() = default;
19 
25  virtual void beginDatabase(size_t numberOfTables) = 0;
26 
32  virtual void endDatabase(size_t numberOfValidatedTables) = 0;
33 
42  virtual bool beginTable(std::string_view tableName, size_t numberOfRows) = 0;
43 
52  virtual bool endTable(std::string_view tableName, size_t numberOfValidatedRows) = 0;
53 
57  enum ErrorType
58  {
63 
68 
73 
78 
83 
88 
93 
98  };
99 
111  virtual bool reportError(std::string_view tableName, std::string_view fieldName,
112  Span<const std::string_view> primaryKeyValues, ErrorType errorType, std::string_view message) = 0;
113 };
114 
115 } // namespace zserio
116 
117 #endif // ZSERIO_I_VALIDATION_OBSERVER_H_INC
virtual bool reportError(std::string_view tableName, std::string_view fieldName, Span< const std::string_view > primaryKeyValues, ErrorType errorType, std::string_view message)=0
virtual void beginDatabase(size_t numberOfTables)=0
virtual bool beginTable(std::string_view tableName, size_t numberOfRows)=0
virtual ~IValidationObserver()=default
virtual bool endTable(std::string_view tableName, size_t numberOfValidatedRows)=0
virtual void endDatabase(size_t numberOfValidatedTables)=0