LAL: Linear Arrangement Library 23.01.00
A library focused on algorithms on linear arrangements of graphs.
Loading...
Searching...
No Matches
report_correctness.hpp
1/*********************************************************************
2 *
3 * Linear Arrangement Library - A library that implements a collection
4 * algorithms for linear arrangments of graphs.
5 *
6 * Copyright (C) 2019 - 2023
7 *
8 * This file is part of Linear Arrangement Library. The full code is available
9 * at:
10 * https://github.com/LAL-project/linear-arrangement-library.git
11 *
12 * Linear Arrangement Library is free software: you can redistribute it
13 * and/or modify it under the terms of the GNU Affero General Public License
14 * as published by the Free Software Foundation, either version 3 of the
15 * License, or (at your option) any later version.
16 *
17 * Linear Arrangement Library is distributed in the hope that it will be
18 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU Affero General Public License for more details.
21 *
22 * You should have received a copy of the GNU Affero General Public License
23 * along with Linear Arrangement Library. If not, see <http://www.gnu.org/licenses/>.
24 *
25 * Contact:
26 *
27 * LluĂ­s Alemany Puig (lalemany@cs.upc.edu)
28 * LARCA (Laboratory for Relational Algorithmics, Complexity and Learning)
29 * CQL (Complexity and Quantitative Linguistics Lab)
30 * Jordi Girona St 1-3, Campus Nord UPC, 08034 Barcelona. CATALONIA, SPAIN
31 * Webpage: https://cqllab.upc.edu/people/lalemany/
32 *
33 * Ramon Ferrer i Cancho (rferrericancho@cs.upc.edu)
34 * LARCA (Laboratory for Relational Algorithmics, Complexity and Learning)
35 * CQL (Complexity and Quantitative Linguistics Lab)
36 * Office S124, Omega building
37 * Jordi Girona St 1-3, Campus Nord UPC, 08034 Barcelona. CATALONIA, SPAIN
38 * Webpage: https://cqllab.upc.edu/people/rferrericancho/
39 *
40 ********************************************************************/
41
42#pragma once
43
44// C++ include
45#include <cstdint>
46#include <string>
47
48namespace lal {
49namespace io {
50
57public:
62
65
68
75 uint64_t line_number,
76 const std::string& error_message
77 )
78 : m_treebank_file_line_number(line_number),
79 m_error_message(error_message)
80 {}
81
86
87 /* GETTERS */
88
90 uint64_t get_line_number() const noexcept { return m_treebank_file_line_number; }
91
93 const std::string& get_error_message() const noexcept { return m_error_message; }
94
95#ifndef SWIG
97 std::string&& get_error_message() noexcept { return std::move(m_error_message); }
98#endif
99
100private:
104 std::string m_error_message;
105};
106
116public:
125
134 const std::string& treebank_file_path,
135 uint64_t main_file_line,
136 uint64_t treebank_line_number,
137 const std::string& error_message
138 ) noexcept
139 : m_treebank_file_path(treebank_file_path),
140 m_main_file_line(main_file_line),
141 m_treebank_file_line_number(treebank_line_number),
142 m_error_message(error_message)
143 {}
144
149
151 const std::string& get_treebank_file_name() const noexcept
152 { return m_treebank_file_path; }
153
155 uint64_t get_line_within_main_file() const noexcept
156 { return m_main_file_line; }
157
159 uint64_t get_treebank_file_line() const noexcept
161
163 const std::string& get_error_message() const noexcept
164 { return m_error_message; }
165
166private:
174 std::string m_error_message;
175};
176
177} // -- namespace io
178} // -- namespace lal
Report on a treebank collection.
Definition: report_correctness.hpp:115
uint64_t m_main_file_line
Line within the main file where the treebank file is found.
Definition: report_correctness.hpp:170
const std::string & get_error_message() const noexcept
Returns the error message.
Definition: report_correctness.hpp:163
std::string m_error_message
Error message.
Definition: report_correctness.hpp:174
const std::string & get_treebank_file_name() const noexcept
Returns the line number within the treebank file where the error is found.
Definition: report_correctness.hpp:151
uint64_t get_line_within_main_file() const noexcept
Returns the error message.
Definition: report_correctness.hpp:155
uint64_t m_treebank_file_line_number
The line number within the treebank file.
Definition: report_correctness.hpp:172
~report_treebank_collection()=default
Default destructor.
report_treebank_collection(const std::string &treebank_file_path, uint64_t main_file_line, uint64_t treebank_line_number, const std::string &error_message) noexcept
Constructor with data.
Definition: report_correctness.hpp:133
report_treebank_collection & operator=(const report_treebank_collection &)=default
Default copy assignment.
report_treebank_collection()=default
Default constructor.
std::string m_treebank_file_path
Filename to the treebank file.
Definition: report_correctness.hpp:168
report_treebank_collection(report_treebank_collection &&)=default
Default move constructor.
uint64_t get_treebank_file_line() const noexcept
Returns the line number within the treebank file where the error is found.
Definition: report_correctness.hpp:159
report_treebank_collection(const report_treebank_collection &)=default
Default copy constructor.
Report on a treebank file.
Definition: report_correctness.hpp:56
uint64_t m_treebank_file_line_number
The line number within the treebank file.
Definition: report_correctness.hpp:102
std::string m_error_message
Error message.
Definition: report_correctness.hpp:104
uint64_t get_line_number() const noexcept
Returns the line number within the treebank file where the error is found.
Definition: report_correctness.hpp:90
report_treebank_file(report_treebank_file &&)=default
Default move constructor.
const std::string & get_error_message() const noexcept
Returns the error message.
Definition: report_correctness.hpp:93
report_treebank_file()=default
Default constructor.
std::string && get_error_message() noexcept
Returns the error message.
Definition: report_correctness.hpp:97
report_treebank_file & operator=(const report_treebank_file &)=default
Default copy assignment.
report_treebank_file(const report_treebank_file &)=default
Default copy constructor.
report_treebank_file(uint64_t line_number, const std::string &error_message)
Constructor.
Definition: report_correctness.hpp:74
~report_treebank_file()=default
Default destructor.
Main namespace of the library.
Definition: basic_types.hpp:50