MarmotJournal.h
Go to the documentation of this file.
1 /* ---------------------------------------------------------------------
2  * _
3  * _ __ ___ __ _ _ __ _ __ ___ ___ | |_
4  * | '_ ` _ \ / _` | '__| '_ ` _ \ / _ \| __|
5  * | | | | | | (_| | | | | | | | | (_) | |_
6  * |_| |_| |_|\__,_|_| |_| |_| |_|\___/ \__|
7  *
8  * Unit of Strength of Materials and Structural Analysis
9  * University of Innsbruck,
10  * 2020 - today
11  *
12  * festigkeitslehre@uibk.ac.at
13  *
14  * Matthias Neuner matthias.neuner@uibk.ac.at
15  *
16  * This file is part of the MAteRialMOdellingToolbox (marmot).
17  *
18  * This library is free software; you can redistribute it and/or
19  * modify it under the terms of the GNU Lesser General Public
20  * License as published by the Free Software Foundation; either
21  * version 2.1 of the License, or (at your option) any later version.
22  *
23  * The full text of the license can be found in the file LICENSE.md at
24  * the top level directory of marmot.
25  * ---------------------------------------------------------------------
26  */
27 #pragma once
28 #include <iostream>
29 #include <sstream>
30 #include <string>
31 
32 class MakeString {
33 public:
34  std::stringstream stream;
35  operator std::string() const { return stream.str(); }
36 
37  template < class T >
38  MakeString& operator<<( T const& VAR )
39  {
40  stream << VAR;
41  return *this;
42  }
43 };
44 
46 private:
48 
49  std::ostream output;
50 
52 
53 public:
54  MarmotJournal( MarmotJournal const& ) = delete;
55  void operator=( MarmotJournal const& ) = delete;
56 
57  static void setMSGOutputDirection( std::ostream& newOutputStream );
58 
59  static bool warningToMSG( const std::string& message );
60 
61  static bool notificationToMSG( const std::string& message );
62 };
MakeString::operator<<
MakeString & operator<<(T const &VAR)
Definition: MarmotJournal.h:38
MarmotJournal
Definition: MarmotJournal.h:45
MarmotJournal::notificationToMSG
static bool notificationToMSG(const std::string &message)
MarmotJournal::output
std::ostream output
Definition: MarmotJournal.h:49
MarmotJournal::operator=
void operator=(MarmotJournal const &)=delete
MarmotJournal::setMSGOutputDirection
static void setMSGOutputDirection(std::ostream &newOutputStream)
MarmotJournal::MarmotJournal
MarmotJournal()
MarmotJournal::MarmotJournal
MarmotJournal(MarmotJournal const &)=delete
MarmotJournal::getInstance
static MarmotJournal & getInstance()
MakeString::stream
std::stringstream stream
Definition: MarmotJournal.h:34
MarmotJournal::warningToMSG
static bool warningToMSG(const std::string &message)
MakeString
Definition: MarmotJournal.h:32