LAL: Linear Arrangement Library 21.07.01
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 - 2021
7 *
8 * This file is part of Linear Arrangement Library. To see the full code
9 * visit the webpage:
10 * https://github.com/lluisalemanypuig/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 <string>
46
47namespace lal {
48namespace io {
49
56public:
61#ifndef SWIG
64#endif
67
74 uint32_t line_number,
75 const std::string& error_message
76 )
77 : m_treebank_file_line_number(line_number),
78 m_error_message(error_message)
79 {}
80
81#ifndef SWIG
86#endif
87
88 /* GETTERS */
89
91 uint32_t get_line_number() const noexcept { return m_treebank_file_line_number; }
92
94 const std::string& get_error_message() const noexcept { return m_error_message; }
95
96private:
100 std::string m_error_message;
101};
102
112public:
117#ifndef SWIG
120#endif
123
132 const std::string& treebank_file_path,
133 uint32_t main_file_line,
134 uint32_t treebank_line_number,
135 const std::string& error_message
136 ) noexcept
137 : m_treebank_file_path(treebank_file_path),
138 m_main_file_line(main_file_line),
139 m_treebank_file_line_number(treebank_line_number),
140 m_error_message(error_message)
141 {}
142
143#ifndef SWIG
148#endif
149
151 const std::string& get_treebank_file_name() const noexcept
152 { return m_treebank_file_path; }
153
155 uint32_t get_line_within_main_file() const noexcept
156 { return m_main_file_line; }
157
159 uint32_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:111
uint32_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
uint32_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
uint32_t get_line_within_main_file() const noexcept
Returns the error message.
Definition report_correctness.hpp:155
~report_treebank_collection()=default
Default destructor.
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.
report_treebank_collection(const std::string &treebank_file_path, uint32_t main_file_line, uint32_t treebank_line_number, const std::string &error_message) noexcept
Constructor with data.
Definition report_correctness.hpp:131
report_treebank_collection(const report_treebank_collection &)=default
Default copy constructor.
uint32_t m_treebank_file_line_number
The line number within the treebank file.
Definition report_correctness.hpp:172
Report on a treebank file.
Definition report_correctness.hpp:55
std::string m_error_message
Error message.
Definition report_correctness.hpp:100
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:94
report_treebank_file()=default
Default constructor.
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(uint32_t line_number, const std::string &error_message)
Constructor.
Definition report_correctness.hpp:73
uint32_t get_line_number() const noexcept
Returns the line number within the treebank file where the error is found.
Definition report_correctness.hpp:91
~report_treebank_file()=default
Default destructor.
uint32_t m_treebank_file_line_number
The line number within the treebank file.
Definition report_correctness.hpp:98
Main namespace of the library.
Definition definitions.hpp:48