76 const std::string root_prefix_domain;
78 environment(
const std::string & root_prefix_domain)
noexcept;
80 static bool local_debug;
82 static void envSet(
const std::string& prefix_domain, std::string basepair)
noexcept;
83 static void envExplodeProperties(
const std::string& prefix_domain,
const std::string& list)
noexcept;
85 static bool getExplodingPropertiesImpl(
const std::string& root_prefix_domain,
const std::string & prefix_domain)
noexcept;
148 static std::string
getProperty(
const std::string & name)
noexcept;
159 static std::string
getProperty(
const std::string & name,
const std::string & default_value)
noexcept;
174 static bool getBooleanProperty(
const std::string & name,
const bool default_value)
noexcept;
186 static int32_t
getInt32Property(
const std::string & name,
const int32_t default_value,
187 const int32_t min_allowed=INT32_MIN,
const int32_t max_allowed=INT32_MAX)
noexcept;
199 static uint32_t
getUint32Property(
const std::string & name,
const uint32_t default_value,
200 const uint32_t min_allowed=0,
const uint32_t max_allowed=UINT32_MAX)
noexcept;
274 return getExplodingPropertiesImpl(
"", prefix_domain);
Main jau environment class, supporting environment variable access and fetching elapsed time using it...
static std::string getProperty(const std::string &name) noexcept
Returns the value of the environment's variable 'name'.
const std::string & getRootPrefixDomain() const noexcept
Returns the project's global singleton root prefix_domain, used at first call of environment::get(con...
const bool verbose
Verbose info logging enabled or disabled.
const bool debug
Debug logging enabled or disabled.
static int32_t getInt32Property(const std::string &name, const int32_t default_value, const int32_t min_allowed=INT32_MIN, const int32_t max_allowed=INT32_MAX) noexcept
Returns the int32_t value of the environment's variable 'name', or the 'default_value' if the environ...
static fraction_i64 getFractionProperty(const std::string &name, const fraction_i64 &default_value, const fraction_i64 &min_allowed, const fraction_i64 &max_allowed) noexcept
Returns the fraction_i64 value of the environment's variable 'name' in format <num>/<denom>,...
static bool getBooleanProperty(const std::string &name, const bool default_value) noexcept
Returns the boolean value of the environment's variable 'name', or the 'default_value' if the environ...
const bool debug_jni
JNI Debug logging enabled or disabled.
static const fraction_timespec startupTimeMonotonic
Module startup time t0 in monotonic time using high precision and range of fraction_timespec.
static environment & get(const std::string &root_prefix_domain="jau") noexcept
Static singleton initialization of this project's environment with the given global root prefix_domai...
static fraction_timespec getElapsedMonotonicTime() noexcept
Returns elapsed monotonic time using fraction_timespec since module startup, see startupTimeMonotonic...
static uint64_t getElapsedMillisecond(const uint64_t ¤t_ts) noexcept
Returns elapsed monotonic time in milliseconds since module startup comparing against the given times...
static const uint64_t startupTimeMilliseconds
Module startup time t0 in monotonic time in milliseconds.
static fraction_timespec getElapsedMonotonicTime(const fraction_timespec ¤t_ts) noexcept
Returns elapsed monotonic time using fraction_timespec since module startup up to the given current_t...
static bool getExplodingProperties(const std::string &prefix_domain) noexcept
Fetches exploding variable-name (prefix_domain) values.
static uint64_t getElapsedMillisecond() noexcept
Returns current elapsed monotonic time in milliseconds since module startup, see startupTimeMilliseco...
static uint32_t getUint32Property(const std::string &name, const uint32_t default_value, const uint32_t min_allowed=0, const uint32_t max_allowed=UINT32_MAX) noexcept
Returns the uint32_t value of the environment's variable 'name', or the 'default_value' if the enviro...
Base jau environment class, merely to tag all environment settings by inheritance and hence documenta...
static void set_terminating() noexcept
Optional path to signal early termination, i.e.
static bool is_terminating() noexcept
Returns true if program is terminating as detected via atexit() callback or set_terminating() has bee...
fraction_timespec getMonotonicTime() noexcept
Returns current monotonic time since Unix Epoch 00:00:00 UTC on 1970-01-01.
__pack(...): Produces MSVC, clang and gcc compatible lead-in and -out macros.
uint64_t getCurrentMilliseconds() noexcept
Returns current monotonic time in milliseconds.
Timespec structure using int64_t for its components in analogy to struct timespec_t on 64-bit platfor...