TBTK
Need a break? Support the development by playing Polarity Puzzles
Communicator.h
Go to the documentation of this file.
1 /* Copyright 2017 Kristofer Björnson
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
24 #ifndef COM_DAFER45_TBTK_COMMUNICATOR
25 #define COM_DAFER45_TBTK_COMMUNICATOR
26 
27 namespace TBTK{
28 
57 public:
58  //TBTKFeature Utilities.Communicator.construction.1 2019-11-01
63  Communicator(bool verbose);
64 
65  //TBTKFeature Utilities.Communicator.setGetVerbose.1 2019-11-01
70  void setVerbose(bool verbose);
71 
72  //TBTKFeature Utilities.Communicator.setGetVerbose.1 2019-11-01
76  bool getVerbose() const;
77 
78  //TBTKFeature Utilities.Communicator.setGetGlobalVerbose.1 2019-11-01
83  static void setGlobalVerbose(bool globalVerbose);
84 
85  //TBTKFeature Utilities.Communicator.setGetGlobalVerbose.1 2019-11-01
89  static bool getGlobalVerbose();
90 private:
92  bool verbose;
93 
95  static bool globalVerbose;
96 };
97 
98 inline void Communicator::setVerbose(bool verbose){
99  this->verbose = verbose;
100 }
101 
102 inline bool Communicator::getVerbose() const{
103  return verbose;
104 }
105 
106 inline void Communicator::setGlobalVerbose(bool globalVerbose){
107  Communicator::globalVerbose = globalVerbose;
108 }
109 
111  return globalVerbose;
112 }
113 
114 }; //End namespace TBTK
115 
116 #endif
TBTK::Communicator::setGlobalVerbose
static void setGlobalVerbose(bool globalVerbose)
Definition: Communicator.h:106
TBTK::Communicator::getVerbose
bool getVerbose() const
Definition: Communicator.h:102
TBTK::Communicator::getGlobalVerbose
static bool getGlobalVerbose()
Definition: Communicator.h:110
TBTK::Communicator
Base class for classes that can communicate their status during execution.
Definition: Communicator.h:56
TBTK::Communicator::setVerbose
void setVerbose(bool verbose)
Definition: Communicator.h:98
TBTK::Communicator::Communicator
Communicator(bool verbose)