OptionParsing
#include <poputil/OptionParsing.hpp>
OptionSpec and OptionHandler used to build up a specification of what options and their values should be, and to translate the value strings to real values.
-
namespace poplibs
PopLibs classes and functions.
Functions
-
class OptionHandler
- #include <OptionParsing.hpp>
Represents the various options types.
Public Functions
Public Static Functions
-
template<typename T, typename ValueMapT = std::map<std::string, T>>
static inline OptionHandler createWithEnum(T &output, ValueMapT &&valueMap)
-
template<typename T>
static inline OptionHandler createWithInteger(T &output)
-
template<typename T>
static inline OptionHandler createWithBool(T &output)
-
template<typename T>
static inline void ensureValueIsWithinBounds(T value, const T &lowerBound, bool lowerBoundIsInclusive, const T &upperBound, bool upperBoundIsInclusive)
-
template<typename T>
static inline OptionHandler createWithDouble(T &output, double lowerBound = std::numeric_limits<double>::min(), bool lowerBoundIsInclusive = true, double upperBound = std::numeric_limits<double>::max(), bool upperBoundIsInclusive = true)
-
static inline OptionHandler createWithString(std::string &output)
-
template<typename T>
static inline OptionHandler createWithList(std::vector<T> &output)
-
template<typename T, typename ValueMapT = std::map<std::string, T>>
-
class OptionSpec
- #include <OptionParsing.hpp>
Represents a set of options and their values.
Public Functions
-
inline OptionSpec(initializer_list_t &&handlers)
Private Types
-
using value_type = std::pair<const std::string, OptionHandler>
-
using map_type = std::map<const std::string, OptionHandler>
-
using initializer_list_t = std::initializer_list<value_type>
-
inline OptionSpec(initializer_list_t &&handlers)
-
namespace parse
-
class OptionHandler