MCPcopy Create free account
hub / github.com/Xtra-Computing/thundersvm / Configuration

Class Configuration

include/thundersvm/util/log.h:1728–1779  ·  view source on GitHub ↗

@brief Represents single configuration that has representing level, configuration type and a string based value. @detail String based value means any value either its boolean, integer or string itself, it will be embedded inside quotes and will be parsed later. Consider some examples below: el::Configuration confEnabledInfo(el::Level::Info, el::ConfigurationType::Enabled, "true"); el::Configurat

Source from the content-addressed store, hash-verified

1726/// * el::Configuration confMaxLogFileSizeInfo(el::Level::Info, el::ConfigurationType::MaxLogFileSize, "2048");
1727/// * el::Configuration confFilenameInfo(el::Level::Info, el::ConfigurationType::Filename, "/var/log/my.log");
1728 class Configuration : public Loggable {
1729 public:
1730 Configuration(const Configuration& c);
1731 Configuration& operator=(const Configuration& c);
1732
1733 virtual ~Configuration(void) {
1734 }
1735
1736 /// @brief Full constructor used to sets value of configuration
1737 Configuration(Level level, ConfigurationType configurationType, const std::string& value);
1738
1739 /// @brief Gets level of current configuration
1740 inline Level level(void) const {
1741 return m_level;
1742 }
1743
1744 /// @brief Gets configuration type of current configuration
1745 inline ConfigurationType configurationType(void) const {
1746 return m_configurationType;
1747 }
1748
1749 /// @brief Gets string based configuration value
1750 inline const std::string& value(void) const {
1751 return m_value;
1752 }
1753
1754 /// @brief Set string based configuration value
1755 /// @param value Value to set. Values have to be std::string; For boolean values use "true", "false", for any integral values
1756 /// use them in quotes. They will be parsed when configuring
1757 inline void setValue(const std::string& value) {
1758 m_value = value;
1759 }
1760
1761 virtual void log(el::base::type::ostream_t& os) const;
1762
1763 /// @brief Used to find configuration from configuration (pointers) repository. Avoid using it.
1764 class Predicate {
1765 public:
1766 Predicate(Level level, ConfigurationType configurationType);
1767
1768 bool operator()(const Configuration* conf) const;
1769
1770 private:
1771 Level m_level;
1772 ConfigurationType m_configurationType;
1773 };
1774
1775 private:
1776 Level m_level;
1777 ConfigurationType m_configurationType;
1778 std::string m_value;
1779 };
1780
1781/// @brief Thread-safe Configuration repository
1782///

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected