crawlserv++  [under development]
Application for crawling and analyzing textual content of websites.
TableColumn.hpp
Go to the documentation of this file.
1 /*
2  *
3  * ---
4  *
5  * Copyright (C) 2020 Anselm Schmidt (ans[ät]ohai.su)
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version in addition to the terms of any
11  * licences already herein identified.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20  *
21  * ---
22  *
23  * TableColumn.hpp
24  *
25  * Structure for table columns.
26  *
27  * Created on: Mar 4, 2019
28  * Author: ans
29  */
30 
31 #ifndef STRUCT_TABLECOLUMN_HPP_
32 #define STRUCT_TABLECOLUMN_HPP_
33 
34 #include <string> // std::string
35 
36 namespace crawlservpp::Struct {
37 
39  struct TableColumn {
42 
44  std::string name;
45 
47  std::string type;
48 
50 
54  std::string referenceTable;
55 
57 
61  std::string referenceColumn;
62 
64  bool indexed;
65 
69 
71 
91  const std::string& setName,
92  const std::string& setType,
93  const std::string& setReferenceTable,
94  const std::string& setReferenceColumn,
95  bool setIndexed
96  ) : name(setName),
97  type(setType),
98  referenceTable(setReferenceTable),
99  referenceColumn(setReferenceColumn),
100  indexed(setIndexed) {}
101 
103 
121  const std::string& setName,
122  const std::string& setType,
123  const std::string& setReferenceTable,
124  const std::string& setReferenceColumn
125  ) : TableColumn(setName, setType, setReferenceTable, setReferenceColumn, false) {}
126 
128 
140  const std::string& setName,
141  const std::string& setType,
142  bool setIndexed
143  ) : TableColumn(setName, setType, "", "", setIndexed) {}
144 
146 
156  const std::string& setName,
157  const std::string& setType
158  ) : TableColumn(setName, setType, "", "", false) {}
159 
161 
169  const TableColumn& other,
170  const std::string& newName
171  ) : TableColumn(newName, other.type, other.referenceTable, other.referenceColumn, other.indexed) {}
172 
174  };
175 
176 } /* namespace crawlservpp::Struct */
177 
178 #endif /* STRUCT_TABLECOLUMN_HPP_ */
TableColumn(const std::string &setName, const std::string &setType, const std::string &setReferenceTable, const std::string &setReferenceColumn)
Constructor setting properties of an unindexed table column.
Definition: TableColumn.hpp:120
std::string referenceTable
Name of the table referenced by the table column.
Definition: TableColumn.hpp:54
std::string name
Name of the table column.
Definition: TableColumn.hpp:44
TableColumn(const std::string &setName, const std::string &setType, const std::string &setReferenceTable, const std::string &setReferenceColumn, bool setIndexed)
Constructor setting all properties of the table column.
Definition: TableColumn.hpp:90
Structure for table columns containing its name, type, reference, and indexing.
Definition: TableColumn.hpp:39
TableColumn(const std::string &setName, const std::string &setType)
Constructor setting properties of an unreferenced and unindexed table column.
Definition: TableColumn.hpp:155
std::string type
Type of the table column as SQL string.
Definition: TableColumn.hpp:47
std::string referenceColumn
Name of the column referenced by the table column (or empty if none).
Definition: TableColumn.hpp:61
bool indexed
Indicates whether the table column is indexed.
Definition: TableColumn.hpp:64
Namespace for data structures.
Definition: AlgoThreadProperties.hpp:43
TableColumn(const std::string &setName, const std::string &setType, bool setIndexed)
Constructor setting properties of an unreferenced table column.
Definition: TableColumn.hpp:139
TableColumn(const TableColumn &other, const std::string &newName)
Constructor copying another table column and setting a new name for the copy.
Definition: TableColumn.hpp:168