Class options#

Nested Relationships#

Nested Types#

Class Documentation#

class options#

Class used to control the different options.

A class to control the different options of f3d. See the README_libf3d.md for the full listing of options

Constructors

options()#

Default/Copy/move constructors/operators.

~options()#

Default/Copy/move constructors/operators.

options(const options &opt)#

Default/Copy/move constructors/operators.

options &operator=(const options &opt) noexcept#

Default/Copy/move constructors/operators.

options(options &&other) noexcept#

Default/Copy/move constructors/operators.

options &operator=(options &&other) noexcept#

Default/Copy/move constructors/operators.

Setters

options &set(const std::string &name, bool value)#

Setters for all supported types.

options &set(const std::string &name, int value)#

Setters for all supported types.

options &set(const std::string &name, double value)#

Setters for all supported types.

options &set(const std::string &name, const std::string &value)#

Setters for all supported types.

options &set(const std::string &name, const char *value)#

Setters for all supported types.

options &set(const std::string &name, const std::vector<int> &values)#

Setters for all supported types.

options &set(const std::string &name, const std::vector<double> &values)#

Setters for all supported types.

options &set(const std::string &name, std::initializer_list<int> values)#

Setters for all supported types.

options &set(const std::string &name, std::initializer_list<double> values)#

Setters for all supported types.

Reference Getters

void get(const std::string &name, bool &value) const#

Copy the option value into the provided reference, for all supported types.

void get(const std::string &name, int &value) const#

Copy the option value into the provided reference, for all supported types.

void get(const std::string &name, double &value) const#

Copy the option value into the provided reference, for all supported types.

void get(const std::string &name, std::string &value) const#

Copy the option value into the provided reference, for all supported types.

void get(const std::string &name, std::vector<int> &value) const#

Copy the option value into the provided reference, for all supported types.

void get(const std::string &name, std::vector<double> &value) const#

Copy the option value into the provided reference, for all supported types.

Explicit Copy Getters

bool getAsBool(const std::string &name) const#

Explicit getters for all supported types.

int getAsInt(const std::string &name) const#

Explicit getters for all supported types.

double getAsDouble(const std::string &name) const#

Explicit getters for all supported types.

std::string getAsString(const std::string &name) const#

Explicit getters for all supported types.

std::vector<int> getAsIntVector(const std::string &name) const#

Explicit getters for all supported types.

std::vector<double> getAsDoubleVector(const std::string &name) const#

Explicit getters for all supported types.

Explicit Reference Getters

bool &getAsBoolRef(const std::string &name)#

Explicit getters to actual reference to the options variable, for all supported types. Modifying the returned reference will modify the option. Throw an options::incompatible_exception if the type is not compatible with the option. Throw an options::inexistent_exception if option does not exist.

int &getAsIntRef(const std::string &name)#

Explicit getters to actual reference to the options variable, for all supported types. Modifying the returned reference will modify the option. Throw an options::incompatible_exception if the type is not compatible with the option. Throw an options::inexistent_exception if option does not exist.

double &getAsDoubleRef(const std::string &name)#

Explicit getters to actual reference to the options variable, for all supported types. Modifying the returned reference will modify the option. Throw an options::incompatible_exception if the type is not compatible with the option. Throw an options::inexistent_exception if option does not exist.

std::string &getAsStringRef(const std::string &name)#

Explicit getters to actual reference to the options variable, for all supported types. Modifying the returned reference will modify the option. Throw an options::incompatible_exception if the type is not compatible with the option. Throw an options::inexistent_exception if option does not exist.

std::vector<int> &getAsIntVectorRef(const std::string &name)#

Explicit getters to actual reference to the options variable, for all supported types. Modifying the returned reference will modify the option. Throw an options::incompatible_exception if the type is not compatible with the option. Throw an options::inexistent_exception if option does not exist.

std::vector<double> &getAsDoubleVectorRef(const std::string &name)#

Explicit getters to actual reference to the options variable, for all supported types. Modifying the returned reference will modify the option. Throw an options::incompatible_exception if the type is not compatible with the option. Throw an options::inexistent_exception if option does not exist.

Public Functions

options &toggle(const std::string &name)#

A boolean option specific method to toggle it.

bool isSame(const options &other, const std::string &name) const#

Compare an option between this and a provided other. Return true is they are the same value, false otherwise. Throw an options::inexistent_exception if option does not exist.

options &copy(const options &other, const std::string &name)#

Copy the value of an option from this to the provided other. Throw an options::inexistent_exception if option does not exist.

std::vector<std::string> getNames()#

Get all available option names.

std::pair<std::string, unsigned int> getClosestOption(const std::string &option) const#

Get the closest option name and its Levenshtein distance.

struct incompatible_exception : public f3d::exception#

An exception that can be thrown by the options when a provided option type is incompatible with its internal type.

Public Functions

explicit incompatible_exception(const std::string &what = "")#
struct inexistent_exception : public f3d::exception#

An exception that can be thrown by the options when a provided option does not exist.

Public Functions

explicit inexistent_exception(const std::string &what = "")#