.. Documentation for the header file dolfin/parameter/Parameter.h .. _programmers_reference_cpp_parameter_parameter: Parameter.h =========== .. note:: The documentation on this page was automatically extracted from the DOLFIN C++ code and may need to be edited or expanded. .. cpp:class:: Parameter Base class for parameters. .. cpp:function:: Parameter(std::string key, T x) Create parameter for given key and value @param key (std::string) @param x (T) .. cpp:function:: Parameter(std::string key, const char* x) Create parameter for given key and value. This verison (const char*) is necessary to have the parameter treated as a string rather than char* being cast as bool. @param key (std::string) @param x (const char*)) .. cpp:function:: enum class Type Enum for the parameter type .. cpp:function:: Parameter(std::string key, Type ptype) Create an unset parameter (type is specified, value is unknown) @param key (std::string) @param ptype (Type)) .. cpp:function:: Parameter(std::string key, T min, T max) Create and unset numerical parameter with specified (min, max) range .. cpp:function:: Parameter(std::string key, std::set range) Create and unset string parameter with set of allowable strings .. cpp:function:: Parameter(const Parameter&) = default Copy constructor .. cpp:function:: Parameter(Parameter&&) = default Move constructor .. cpp:function:: Parameter& operator= (const Parameter &) = default Assignment operator .. cpp:function:: std::string key() const Return parameter key @return std::string .. cpp:function:: std::string description() const Return parameter description @return std::string .. cpp:function:: bool is_set() const Return true if parameter is set, return false otherwise @return bool .. cpp:function:: void reset() Reset the parameter to empty, so that is_set() returns false. .. cpp:function:: std::size_t access_count() const Return access count (number of times parameter has been accessed) @return std::size_t .. cpp:function:: std::size_t change_count() const Return change count (number of times parameter has been changed) @return std::size_t .. cpp:function:: void set_range(int min_value, int max_value) Set range for int-valued parameter @param min_value (int) @param max_value (int) .. cpp:function:: void set_range(double min_value, double max_value) Set range for double-valued parameter @param min_value (double) @param max_value (double) .. cpp:function:: void set_range(std::set range) Set range for string-valued parameter @param range (std::set) .. cpp:function:: void get_range(int& min_value, int& max_value) const Get range for int-valued parameter @param [out] min_value (int) @param [out] max_value (int) .. cpp:function:: void get_range(double& min_value, double& max_value) const Get range for double-valued parameter @param [out] min_value (double) @param [out] max_value (double) .. cpp:function:: void get_range(std::set& range) const Get range for string-valued parameter @param [out] range (std::set) .. cpp:function:: const Parameter& operator= (int value) Assignment from int @param value (int) .. cpp:function:: const Parameter& operator= (double value) Assignment from double @param value (double) .. cpp:function:: const Parameter& operator= (std::string value) Assignment from string @param value (std::string) .. cpp:function:: const Parameter& operator= (const char* value) Assignment from string @param value (char *) .. cpp:function:: const Parameter& operator= (bool value) Assignment from bool @param value (bool) .. cpp:function:: boost::variant value() const Return parameter value .. cpp:function:: operator int() const Cast parameter to int .. cpp:function:: operator std::size_t() const Cast parameter to std::size_t .. cpp:function:: operator double() const Cast parameter to double .. cpp:function:: operator std::string() const Cast parameter to string .. cpp:function:: operator bool() const Cast parameter to bool .. cpp:function:: std::string type_str() const Return value type string .. cpp:function:: std::string value_str() const Return value string .. cpp:function:: std::string range_str() const Return range string .. cpp:function:: std::string str() const Return short string description .. cpp:function:: static void check_key(std::string key) Check that key name is allowed