51 virtual void set(
const std::string& key,
const std::string& value ) = 0;
53 virtual std::string
get(
const std::string& key,
const std::string& default_ = {} )
const = 0;
56 virtual std::string
pop(
const std::string& key,
const std::string& default_ = {} ) = 0;
58 virtual bool has(
const std::string& key )
const = 0;
60 virtual bool isSet(
const std::string& key )
const = 0;
68 template <
class UnaryPredicate>
70 auto v = this->
items();
72 [&predicate](
const auto& element ) {
return !predicate( element ); } ),
80 [&filter, &match](
const auto& element ) {
return regex_match(
std::get<0>( element ), match, filter ); } );
constexpr const __tuple_element_t< __i, tuple< _Elements... > > && get(const tuple< _Elements... > &&__t) noexcept
constexpr _ForwardIterator remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
bool regex_match(_Bi_iter __first, _Bi_iter __last, const basic_regex< _Ch_type, _Rx_traits > &__re, regex_constants::match_flag_type __flags=regex_constants::match_default)
basic_regex< char > regex
constexpr auto begin(_Container &__cont) -> decltype(__cont.begin())
constexpr auto end(_Container &__cont) -> decltype(__cont.end())
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition of the basic interface.
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Interface for a component that manages application configuration options.
virtual std::vector< std::tuple< std::string, std::string > > items() const =0
Return all known options with their values.
std::vector< std::tuple< std::string, std::string > > items(const std::regex &filter) const
Return all known options with their values for which the key matches the given regular expression.
DeclareInterfaceID(IOptionsSvc, 2, 0)
InterfaceID declaration.
virtual bool isSet(const std::string &key) const =0
Test if an option key was explicitly set or not.
virtual void bind(const std::string &prefix, Gaudi::Details::PropertyBase *property)=0
Register a Gaudi::Property instance to the option service.
virtual void set(const std::string &key, const std::string &value)=0
Set the value of an option, overriding the old value, if any.
virtual bool has(const std::string &key) const =0
Test if an option key is available in the catalog.
virtual std::string get(const std::string &key, const std::string &default_={}) const =0
Get the value of an options, returning the specified default value if not found.
virtual std::string pop(const std::string &key, const std::string &default_={})=0
Get the value of an options, removing it from the storage, returning the specified default value if n...
virtual void broadcast(const std::regex &filter, const std::string &value, OnlyDefaults defaults=OnlyDefaults{ true })=0
Broadcast version of IOptionsSvc::set.
virtual ~IOptionsSvc()=default
std::vector< std::tuple< std::string, std::string > > items(UnaryPredicate predicate) const
Return all known options with their values for which predicate evaluates to true.
Gaudi::tagged_bool< class OnlyDefaults_tag > OnlyDefaults