Mantid
Loading...
Searching...
No Matches
EnvironmentHistory.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7//----------------------------------------------------------------------
8// Includes
9//----------------------------------------------------------------------
13#include <ostream>
14
15namespace Mantid::Kernel {
16
26std::string EnvironmentHistory::osName() const { return ConfigService::Instance().getOSName(); }
31std::string EnvironmentHistory::osVersion() const { return ConfigService::Instance().getOSVersion(); }
32
38void EnvironmentHistory::printSelf(std::ostream &os, const int indent) const {
39 os << std::string(indent, ' ') << "Framework Version: " << frameworkVersion() << '\n';
40 os << std::string(indent, ' ') << "OS name: " << osName() << '\n';
41 os << std::string(indent, ' ') << "OS version: " << osVersion() << '\n';
42}
43
49std::ostream &operator<<(std::ostream &os, const EnvironmentHistory &EH) {
50 EH.printSelf(os);
51 return os;
52}
53
54} // namespace Mantid::Kernel
This class stores information about the Environment of the computer used by the framework.
std::string osName() const
returns the os name
std::string frameworkVersion() const
returns the framework version
void printSelf(std::ostream &, const int indent=0) const
print contents of object
std::string osVersion() const
returns the os version
static const char * version()
The full version number.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
MANTID_KERNEL_DLL std::ostream & operator<<(std::ostream &, CPUTimer &)
Convenience function to provide for easier debug printing.
Definition: CPUTimer.cpp:86