OpenMS
Loading...
Searching...
No Matches
QPXValueValidation.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Timo Sachsenberg $
6// $Authors: Timo Sachsenberg $
7// --------------------------------------------------------------------------
8
9#pragma once
10
11#include <OpenMS/config.h>
12
13#include <memory>
14#include <string>
15#include <vector>
16
17namespace arrow
18{
19 class Table;
20}
21
22namespace OpenMS
23{
41 class OPENMS_DLLAPI QPXValueValidation
42 {
43 public:
45 enum class View
46 {
47 PSM,
48 FEATURE,
49 PROTEIN_GROUP
50 };
51
53 struct OPENMS_DLLAPI Result
54 {
55 bool valid = true;
56 std::vector<std::string> errors;
57
63 std::string toString() const;
64 };
65
71 explicit QPXValueValidation(View view);
73
75 QPXValueValidation& operator=(QPXValueValidation&&) noexcept;
76
78 QPXValueValidation& operator=(const QPXValueValidation&) = delete;
79
94 Result validate(const std::shared_ptr<arrow::Table>& table);
95
97 void reset();
98
99 private:
100 struct Impl;
101 std::unique_ptr<Impl> impl_;
102 };
103} // namespace OpenMS
Stateful value and primary-key validator for QPX Arrow tables.
Definition QPXValueValidation.h:42
QPXValueValidation(QPXValueValidation &&) noexcept
QPXValueValidation(View view)
Construct a validator for one QPX view.
View
QPX table whose value contract is checked.
Definition QPXValueValidation.h:46
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Definition ArrowIOHelpers.h:24
STL namespace.
Result of validating one table or streaming batch.
Definition QPXValueValidation.h:54
std::string toString() const
Join all diagnostics into one log-friendly string.
std::vector< std::string > errors
Definition QPXValueValidation.h:56