Poplar and PopLibs
poplar::OptionFlags Class Reference

A set of option/value string flags to be used in various APIs. More...

#include <OptionFlags.hpp>

Public Member Functions

 OptionFlags ()
 Construct a set of option flags. More...
 
bool operator== (const OptionFlags &other) const
 Option flags are an exact match. More...
 
 OptionFlags (initializer_list &&list)
 Construct a set of option flags from an initializer list of string pairs. More...
 
void set (initializer_list &&list)
 Set option flags from an initializer list of string pairs. More...
 
void set (StringRef option, StringRef value)
 Set a single option to a value. More...
 
StringRef at (StringRef option) const
 Retrieves the value of the given option. More...
 
void clear ()
 Remove all set flags.
 
iterator begin () const
 Get iterators for the currently set option flags. More...
 

Detailed Description

A set of option/value string flags to be used in various APIs.

Constructor & Destructor Documentation

◆ OptionFlags() [1/2]

poplar::OptionFlags::OptionFlags ( )

Construct a set of option flags.

The default constructor creates an empty set of flags.

◆ OptionFlags() [2/2]

poplar::OptionFlags::OptionFlags ( initializer_list &&  list)
inline

Construct a set of option flags from an initializer list of string pairs.

Flags are set in the order they appear in the constructor.

Setting a flag more than once will result in the previous value for that option being overwritten.

Parameters
initializerA list of option/value string pairs to set in the flags.

Member Function Documentation

◆ at()

StringRef poplar::OptionFlags::at ( StringRef  option) const

Retrieves the value of the given option.

If the option does not exist, then an exception is thrown.

Parameters
optionThe option to retrieve in the flags.

◆ begin()

iterator poplar::OptionFlags::begin ( ) const

Get iterators for the currently set option flags.

All iterators are invalidated when a new flag is set or the option flags are re-assigned.

◆ operator==()

bool poplar::OptionFlags::operator== ( const OptionFlags other) const

Option flags are an exact match.

Each collection contains the same keys, and both collections have the same values for each key

◆ set() [1/2]

void poplar::OptionFlags::set ( initializer_list &&  list)

Set option flags from an initializer list of string pairs.

Flags are set in the order they appear in the list.

Setting a flag more than once will result in the previous value for that option being overwritten. If the option was already set in these flags then the previous value will be overwritten.

Parameters
initializerA list of option/value string pairs to set in the flags.

◆ set() [2/2]

void poplar::OptionFlags::set ( StringRef  option,
StringRef  value 
)

Set a single option to a value.

If the option was already set in these flags then the previous value will be over- written.

Parameters
optionThe option to set in the flags.
valueThe value to set the option to in the flags.

The documentation for this class was generated from the following file: