OpenMPCD
HostInformation.hpp
Go to the documentation of this file.
1 /**
2  * @file
3  * Defines functions that provide information about the host the program
4  * is executed on.
5  */
6 
7 #ifndef OPENMPCD_UTILITY_HOSTINFORMATION_HPP
8 #define OPENMPCD_UTILITY_HOSTINFORMATION_HPP
9 
10 #include <string>
11 
12 namespace OpenMPCD
13 {
14 
15 /**
16  * Holds utility functionality.
17  */
18 namespace Utility
19 {
20 
21 /**
22  * Provides functions that give information about the host the program is being
23  * executed on.
24  */
25 namespace HostInformation
26 {
27 
28 /**
29  * Returns the hostname of the machine this program is being executed on.
30  */
31 const std::string getHostname();
32 
33 /**
34  * Returns the current time in UTC as a string, formatted as
35  * `YYYY-MM-DDTHH:MM:SS`.
36  *
37  * @warning
38  * This function may call `std::gmtime`, so its interal `std::tm` object may be
39  * changed. Furthermore, this implies that this function might not be
40  * thread-safe.
41  */
42 const std::string getCurrentUTCTimeAsString();
43 
44 } //namespace HostInformation
45 } //namespace Utility
46 } //namespace OpenMPCD
47 
48 #endif //OPENMPCD_UTILITY_HOSTINFORMATION_HPP
OpenMPCD::Utility::HostInformation::getCurrentUTCTimeAsString
const std::string getCurrentUTCTimeAsString()
Returns the current time in UTC as a string, formatted as YYYY-MM-DDTHH:MM:SS.
Definition: HostInformation.cpp:21
OpenMPCD::Utility::HostInformation::getHostname
const std::string getHostname()
Returns the hostname of the machine this program is being executed on.
Definition: HostInformation.cpp:16