Wrapper around workspace to have read and write access to merged (workspace + project) preferences.
More...
|
template<typename T > |
std::enable_if< std::is_same< T, std::string >::value, T >::type | Get (const boost::property_tree::ptree::path_type &) const |
|
template<typename T > |
std::enable_if<!std::is_same< T, std::string >::value, T >::type | Get (const boost::property_tree::ptree::path_type &) const |
|
template<typename T > |
std::enable_if< std::is_same< T, std::string >::value, T >::type | Get (const boost::property_tree::ptree::path_type &, const T &) const |
|
template<typename T > |
std::enable_if<!std::is_same< T, std::string >::value, T >::type | Get (const boost::property_tree::ptree::path_type &, const T &) const |
|
template<typename T > |
std::enable_if< std::is_same< T, std::string >::value, T >::type | Get (const boost::property_tree::ptree::path_type &p) const |
|
template<typename T > |
std::enable_if<!std::is_same< T, std::string >::value, T >::type | Get (const boost::property_tree::ptree::path_type &p) const |
|
template<typename T > |
std::enable_if< std::is_same< T, std::string >::value, T >::type | Get (const boost::property_tree::ptree::path_type &p, const T &v) const |
|
template<typename T > |
std::enable_if<!std::is_same< T, std::string >::value, T >::type | Get (const boost::property_tree::ptree::path_type &p, const T &v) const |
|
std::shared_ptr< MergedPreferences > | GetChild (const boost::property_tree::ptree::path_type &) const |
| Get MergedPreferences instance for working with preferences subtree.
|
|
std::shared_ptr< MergedPreferences > | GetGlobal () const |
| Get MergedPreferences instance pointing to global preferences. (undoes GetChild() operations)
|
|
const std::string & | GetPath () const |
| Get path of project.
|
|
const boost::property_tree::ptree & | GetProjectPreferencesTree () |
| Get project preferences.
|
|
template<typename T > |
void | Put (const boost::property_tree::ptree::path_type &, const T &) |
| Put value at given path in project preferences if another value at the same path exists, otherwise, put value in workspace preferences. More...
|
|
void | Notify (const EventType &) |
|
void | Register (const U *, CallbackType) |
|
void | Unregister (const U *) |
|
void | UnregisterAll () |
|
Wrapper around workspace to have read and write access to merged (workspace + project) preferences.
Translates workspace + project preferences into merged preferences, Listens for Ws::Event::PreferencesChanged events (coming from IWorskpace or IProject) and translates them into (by being a subject of) Event::PreferencesChanged events.
This way, ISession and its viewers can read from and write to preferences without being exposed to workspace details.
Definition at line 50 of file MergedPreferences.h.
template<typename T >
void SimShell::Ws::MergedPreferences::Put |
( |
const boost::property_tree::ptree::path_type & |
p, |
|
|
const T & |
v |
|
) |
| |
|
inline |
Put value at given path in project preferences if another value at the same path exists, otherwise, put value in workspace preferences.
This operation is rather slow since it also causes the internal workspace or project to write preferences to disk.
- Exceptions
-
ptree_bad_data | if no conversion to type T. (see boost ptree doc for ptree::put_value) |
Definition at line 173 of file MergedPreferences.h.