7 #if !defined(_OptionDictionary_h_) 8 #define _OptionDictionary_h_ 10 #include "OptionContext.h" 59 virtual bool hasOption(
const std::string &name)
const;
115 #endif // _OptionDictionary_h_ OptionDictionary(OptionContext *parent)
Constructor taking a parent context.
Definition: OptionDictionary.h:37
std::map< std::string, OptionValue > option_map_t
Map from option name to value.
Definition: OptionDictionary.h:109
void unlockOption(const std::string &name)
Allow an option to be changed.
Definition: OptionDictionary.cpp:153
virtual const Value * getOption(const std::string &name) const
Returns the option's value.
Definition: OptionDictionary.cpp:50
OptionValue()
Constructor.
Definition: OptionDictionary.h:102
void lockOption(const std::string &name)
Prevent further modifications of an option's value.
Definition: OptionDictionary.cpp:141
option_map_t m_options
The option dictionary.
Definition: OptionDictionary.h:110
Concrete implementation of OptionContext.
Definition: OptionDictionary.h:27
Value * m_value
The object for this option's value.
Definition: OptionDictionary.h:98
OptionContext * getParent() const
Returns the current parent context.
Definition: OptionDictionary.h:50
bool isOptionLocked(const std::string &name) const
Returns true if the specified option is locked from further changes.
Definition: OptionDictionary.cpp:128
~OptionDictionary()
Destructor.
Definition: OptionDictionary.cpp:14
void setParent(OptionContext *newParent)
Change the parent context.
Definition: OptionDictionary.h:54
Definition: BootImage.h:13
Abstract base class for values of arbitrary types.
Definition: apps/elftosb/common/Value.h:20
Pure abstract interface class to a table of options.
Definition: apps/elftosb/common/OptionContext.h:18
virtual void setOption(const std::string &name, Value *value)
Adds or changes an option's value.
Definition: OptionDictionary.cpp:82
virtual bool hasOption(const std::string &name) const
Detemine whether the named option is present in the table.
Definition: OptionDictionary.cpp:32
const Value * operator[](const std::string &name) const
Indexing operator; returns the value for the option name.
Definition: OptionDictionary.cpp:165
Information about one option's value.
Definition: OptionDictionary.h:96
bool m_isLocked
True if this value is locked from further changes.
Definition: OptionDictionary.h:99
OptionContext * m_parent
Our parent context.
Definition: OptionDictionary.h:91
virtual void deleteOption(const std::string &name)
Removes an option from the table.
Definition: OptionDictionary.cpp:112
OptionDictionary()
Default constructor.
Definition: OptionDictionary.h:31