lib_settings.h
Go to the documentation of this file.
1 /*
2  -------------------------------------------------------------------
3 
4  Copyright (C) 2006-2017, Andrew W. Steiner
5 
6  This file is part of O2scl.
7 
8  O2scl is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 3 of the License, or
11  (at your option) any later version.
12 
13  O2scl is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with O2scl. If not, see <http://www.gnu.org/licenses/>.
20 
21  -------------------------------------------------------------------
22 */
23 #ifndef O2SCL_LIB_SETTINGS_H
24 #define O2SCL_LIB_SETTINGS_H
25 #include <iostream>
26 #include <string>
27 
28 #include <o2scl/convert_units.h>
29 
30 /** \file lib_settings.h
31  \brief Library settings class and global settings object
32 */
33 
34 /** \brief The main \o2 namespace
35 
36  By default, all \o2 classes and functions which are not listed as
37  being in one of \o2's smaller specialized namespaces are in this
38  namespace.
39 
40  \comment
41  \htmlonly
42  For a full list of all the
43  O<span style='position: relative; top: 0.3em; font-size: 0.8em'>2</span>scl
44  classes, see
45  <a href="annotated.html">Data Structures</a>.
46  \endhtmlonly
47  \endcomment
48 
49  This namespace documentation is in the file
50  <tt>src/base/lib_settings.h</tt>
51 */
52 /*
53  \comment
54  For a full list of all the
55  O<span style='position: relative; top: 0.3em; font-size: 0.8em'>2</span>scl
56  global objects which are not
57  classes, see <a href="globals.html">Files::Globals</a>.
58  \endcomment
59 */
60 namespace o2scl {
61 }
62 
63 #ifndef DOXYGEN_NO_O2NS
64 namespace o2scl {
65 #endif
66 
67  /** \brief A class to manage global library settings
68 
69  This class reports global \o2 settings such as the current
70  version, whether or not sub-libraries were installed and what
71  the current parent directory for \o2 data files is.
72 
73  A global object of this type is defined in
74  <tt>lib_settings.h</tt> named \ref o2scl_settings .
75  */
77 
78  public:
79 
81 
83 
84  /** \brief Return the data directory */
85  std::string get_data_dir() {
86  return data_dir;
87  }
88 
89  /** \brief Set the data directory */
90  int set_data_dir(std::string dir) {
91  data_dir=dir;
92  return 0;
93  }
94 
95  /// Return true if the EOS library was installed
96  bool eos_installed();
97 
98  /// Return true if the particle library was installed
99  bool part_installed();
100 
101  /// Return true if \o2 was installed with HDF support
102  bool hdf_support();
103 
104  /// Return true if \o2 was installed with OpenMP support
105  bool openmp_support();
106 
107  /// Return true if \o2 was installed with support for GSL V2.0+
108  bool gsl2_support();
109 
110  /// Return true if \o2 was installed with Armadillo support
111  bool armadillo_support();
112 
113  /// Return true if \o2 was installed with Eigen support
114  bool eigen_support();
115 
116  /** \brief Return true if range checking was turned on during
117  installation (default true)
118  */
119  bool range_check();
120 
121  /// Return the time \o2 was compiled
122  std::string time_compiled();
123 
124  /// Return the date \o2 was compiled
125  std::string date_compiled();
126 
127  /// Return the library version
128  std::string o2scl_version();
129 
130  /// Report some of the settings from config.h
131  void config_h_report();
132 
133  /// \name Miscellaneous config.h string properties
134  //@{
135  std::string o2scl_name();
136  std::string o2scl_package();
137  std::string o2scl_bugreport();
138  std::string o2scl_string();
139  std::string o2scl_tarname();
140  //@}
141 
142  /// Default convert units object
144 
145  /// Get the global convert_units object
147  return *cup;
148  }
149 
150  /// Set the global convert_units object
152  cup=&cu;
153  }
154 
155  protected:
156 
157 #ifndef DOXYGEN_INTERNAL
158 
159  /// The present data directory
160  std::string data_dir;
161 
162  /// Pointer to current \ref convert_units object
164 
165 #endif
166 
167  };
168 
169  /** \brief The global library settings object
170 
171  This global object is used by \ref polylog and some of the \o2e
172  classes to find data files. It may also be used by the end-user
173  to probe details of the \o2 installation.
174  */
176 
177 #ifndef DOXYGEN_NO_O2NS
178 }
179 #endif
180 
181 #endif
bool openmp_support()
Return true if O<span style=&#39;position: relative; top: 0.3em; font-size: 0.8em&#39;>2</span>scl O$_2$scl ...
The main O<span style=&#39;position: relative; top: 0.3em; font-size: 0.8em&#39;>2</span>scl O$_2$scl names...
Definition: anneal.h:42
convert_units def_cu
Default convert units object.
Definition: lib_settings.h:143
std::string time_compiled()
Return the time O<span style=&#39;position: relative; top: 0.3em; font-size: 0.8em&#39;>2</span>scl O$_2$scl...
bool armadillo_support()
Return true if O<span style=&#39;position: relative; top: 0.3em; font-size: 0.8em&#39;>2</span>scl O$_2$scl ...
bool part_installed()
Return true if the particle library was installed.
void config_h_report()
Report some of the settings from config.h.
lib_settings_class o2scl_settings
The global library settings object.
Convert units.
Definition: convert_units.h:88
std::string get_data_dir()
Return the data directory.
Definition: lib_settings.h:85
convert_units * cup
Pointer to current convert_units object.
Definition: lib_settings.h:163
A class to manage global library settings.
Definition: lib_settings.h:76
std::string o2scl_version()
Return the library version.
bool eos_installed()
Return true if the EOS library was installed.
std::string data_dir
The present data directory.
Definition: lib_settings.h:160
convert_units & get_convert_units()
Get the global convert_units object.
Definition: lib_settings.h:146
int set_data_dir(std::string dir)
Set the data directory.
Definition: lib_settings.h:90
bool gsl2_support()
Return true if O<span style=&#39;position: relative; top: 0.3em; font-size: 0.8em&#39;>2</span>scl O$_2$scl ...
bool hdf_support()
Return true if O<span style=&#39;position: relative; top: 0.3em; font-size: 0.8em&#39;>2</span>scl O$_2$scl ...
std::string date_compiled()
Return the date O<span style=&#39;position: relative; top: 0.3em; font-size: 0.8em&#39;>2</span>scl O$_2$scl...
bool range_check()
Return true if range checking was turned on during installation (default true)
bool eigen_support()
Return true if O<span style=&#39;position: relative; top: 0.3em; font-size: 0.8em&#39;>2</span>scl O$_2$scl ...
void set_convert_units(convert_units &cu)
Set the global convert_units object.
Definition: lib_settings.h:151

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).