File guarded_options.hxx#
-
class GuardedOptions#
- #include <guarded_options.hxx>
A wrapper class around BOUT++ Options objects. It uses access right data, stored using a Permissions object, to control reading from and writing to the underlying data.
Public Functions
-
GuardedOptions() = delete#
-
GuardedOptions(Options *options, Permissions *permissions)#
Create a guarded options object which applies the specified permissions to the underlying options object. Note that the variable names used in the Permissions object must always be the full names, relative to the highest-level of the Options hierarchy.
-
inline GuardedOptions operator[](const std::string &name) const#
Get a subsection or value. The result will also be wrapped in a GuardedOptions object, with the same permissions as this one.
-
inline GuardedOptions operator[](const char *name) const#
-
std::map<std::string, GuardedOptions> getChildren()#
-
inline bool isSection(const std::string &name) const#
-
inline bool isSection(const char *name) const#
-
inline bool isSection() const#
-
inline bool isSet(const std::string &name) const#
-
inline bool isSet(const char *name) const#
-
inline bool isSet() const#
-
inline std::string name() const#
-
const Options &get(Regions region = Regions::All) const#
Get read-only access to the underlying Options object. Throws BoutException if there is not read-permission for this object.
-
template<typename T>
const T &GetRef(Regions region = Regions::All) const# Get const ref to a value of type T. Throws BoutException if we don’t have read permission, or if the type is wrong.
-
Options &getWritable(Regions region = Regions::All)#
Get read-write access to the underlying Options object. Throws BoutException if there is not write-permission for this object.
-
inline std::map<std::string, Regions> unreadItems() const#
Returns a list of variables with read-only permission but which have not been accessed using the
get()method.
-
inline std::map<std::string, Regions> unwrittenItems() const#
Returns a list of variables with read-write permission but which have not been accessed using the
getWritable()method.
-
bool operator==(const GuardedOptions &other) const#
-
bool operator!=(const GuardedOptions &other) const#
-
inline PermissionTypes getHighestPermission(Regions region = Regions::All) const#
Private Functions
-
GuardedOptions() = delete#