crawlserv++  [under development]
Application for crawling and analyzing textual content of websites.
ThreadStatus.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  * ThreadStatus.hpp
24  *
25  * Thread status (thread ID, status message, pause state and progress, i.e. last ID processed)
26  *
27  * Created on: Apr 30, 2019
28  * Author: ans
29  */
30 
31 #ifndef STRUCT_THREADSTATUS_HPP_
32 #define STRUCT_THREADSTATUS_HPP_
33 
34 #include <cstdint> // std::uint64_t
35 #include <string> // std::string
36 
37 namespace crawlservpp::Struct {
38 
40 
54  struct ThreadStatus {
57 
59  std::uint64_t id{};
60 
62  std::string status;
63 
65  bool paused{false};
66 
68  std::uint64_t last{};
69 
71  std::uint64_t processed{};
72 
76 
78  ThreadStatus() = default;
79 
81 
95  std::uint64_t setId,
96  const std::string& setStatus,
97  bool setPaused,
98  std::uint64_t setLast,
99  std::uint64_t setProcessed
100  ) : id(setId), status(setStatus), paused(setPaused), last(setLast), processed(setProcessed) {}
101 
103  };
104 
105 } /* namespace crawlservpp::Struct */
106 
107 #endif /* STRUCT_THREADSTATUS_HPP_ */
ThreadStatus()=default
Default constructor.
Thread status containing its ID, status message, pause state, and progress.
Definition: ThreadStatus.hpp:54
std::uint64_t last
The last ID processed by the thread.
Definition: ThreadStatus.hpp:68
ThreadStatus(std::uint64_t setId, const std::string &setStatus, bool setPaused, std::uint64_t setLast, std::uint64_t setProcessed)
Constructor setting the status of the thread.
Definition: ThreadStatus.hpp:94
std::uint64_t processed
The number of IDs processed by the thread.
Definition: ThreadStatus.hpp:71
std::string status
The status message of the thread.
Definition: ThreadStatus.hpp:62
Namespace for data structures.
Definition: AlgoThreadProperties.hpp:43
std::uint64_t id
The ID of the thread.
Definition: ThreadStatus.hpp:59
bool paused
Indicates whether the thread is paused at the moment.
Definition: ThreadStatus.hpp:65