votca 2024.2-dev
Loading...
Searching...
No Matches
qmthread.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2020 The VOTCA Development Team
3 * (http://www.votca.org)
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License")
6 *
7 * You may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 */
21
22#pragma once
23#ifndef VOTCA_XTP_QMTHREAD_H
24#define VOTCA_XTP_QMTHREAD_H
25
26// Standard includes
27#include <ctime>
28#include <iostream>
29#include <string>
30
31// VOTCA includes
32#include <votca/tools/globals.h>
33#include <votca/tools/thread.h>
34
35// Local VOTCA includes
36#include "logger.h"
37
38namespace votca {
39namespace xtp {
40
41// ++++++++++++++++++++++++++++++++++++++ //
42// Thread class with local string stream //
43// ++++++++++++++++++++++++++++++++++++++ //
44
45class QMThread : public tools::Thread {
46 public:
47 QMThread() = default;
48 QMThread(bool maverick) : maverick_(maverick) { ; }
49 ~QMThread() override = default;
50
51 Index getId() const { return id_; }
52 void setId(Index id) { id_ = id; }
53 bool isMaverick() const { return maverick_; }
54
55 Logger& getLogger() { return logger_; }
56 void Run(void) override { ; }
57
58 protected:
60 std::stringstream ss_;
61 bool maverick_ = false;
63};
64
65} // namespace xtp
66} // namespace votca
67
68#endif // VOTCA_XTP_QMTHREAD_H
Framework for threaded execution.
Definition thread.h:35
Logger is used for thread-safe output of messages.
Definition logger.h:164
Index getId() const
Definition qmthread.h:51
bool isMaverick() const
Definition qmthread.h:53
Logger & getLogger()
Definition qmthread.h:55
~QMThread() override=default
void setId(Index id)
Definition qmthread.h:52
void Run(void) override
Run() executes the actual code.
Definition qmthread.h:56
QMThread(bool maverick)
Definition qmthread.h:48
std::stringstream ss_
Definition qmthread.h:60
base class for all analysis tools
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26