OpenWalnut
1.5.0dev
|
Encapsulates a WProperty. More...
#include <WPropertyWrapper.h>
Public Member Functions | |
WPropertyWrapper (std::shared_ptr< WPropertyBase > prop) | |
Constructor. More... | |
std::string | getName () const |
Return the name of the property. More... | |
std::string | getDescription () const |
Return the description of the property. More... | |
bool | getBool (bool notify=false) const |
Get the value of a boolean property. More... | |
int | getInt (bool notify=false) const |
Get the value of an integer property. More... | |
std::string | getString (bool notify=false) const |
Get the value of a string property. More... | |
double | getDouble (bool notify=false) const |
Get the value of a double property. More... | |
std::string | getFilename (bool notify=false) const |
Get the filename of a filename property. More... | |
int | getSelection (bool notify=false) const |
Get the (first) selected item of a selection property. More... | |
WColorWrapper | getColor (bool notify=false) const |
Get the color of a color property. More... | |
void | setBool (bool b) |
Set the value of a boolean property. More... | |
void | setInt (int i) |
Set the value of an integer property. More... | |
void | setString (std::string const &s) |
Set the value of a string property. More... | |
void | setDouble (double d) |
Set the value of a double property. More... | |
void | setFilename (std::string const &fn) |
Set the filename of the filename property. More... | |
void | setSelection (int s) |
Sets the selected item of a selection. More... | |
void | setColor (WColorWrapper col) |
Set the color of a color property. More... | |
void | click () |
Trigger a trigger property. More... | |
void | waitForUpdate () |
Wait for the property to update its value. More... | |
Private Attributes | |
std::shared_ptr< WPropertyBase > | m_prop |
The property. More... | |
Encapsulates a WProperty.
Used to expose the properties to scripts.
Definition at line 40 of file WPropertyWrapper.h.
|
explicit |
void WPropertyWrapper::click | ( | ) |
Trigger a trigger property.
Definition at line 121 of file WPropertyWrapper.cpp.
References m_prop, and WPVBaseTypes::PV_TRIGGER_TRIGGERED.
bool WPropertyWrapper::getBool | ( | bool | notify = false | ) | const |
Get the value of a boolean property.
notify | If true, informs the property that it was read. |
Definition at line 47 of file WPropertyWrapper.cpp.
References m_prop.
WColorWrapper WPropertyWrapper::getColor | ( | bool | notify = false | ) | const |
Get the color of a color property.
notify | If true, informs the property that it was read. |
Definition at line 77 of file WPropertyWrapper.cpp.
References m_prop.
std::string WPropertyWrapper::getDescription | ( | ) | const |
Return the description of the property.
Definition at line 42 of file WPropertyWrapper.cpp.
References m_prop.
double WPropertyWrapper::getDouble | ( | bool | notify = false | ) | const |
Get the value of a double property.
notify | If true, informs the property that it was read. |
Definition at line 62 of file WPropertyWrapper.cpp.
References m_prop.
std::string WPropertyWrapper::getFilename | ( | bool | notify = false | ) | const |
Get the filename of a filename property.
notify | If true, informs the property that it was read. |
Definition at line 67 of file WPropertyWrapper.cpp.
References m_prop.
int WPropertyWrapper::getInt | ( | bool | notify = false | ) | const |
Get the value of an integer property.
notify | If true, informs the property that it was read. |
Definition at line 52 of file WPropertyWrapper.cpp.
References m_prop.
std::string WPropertyWrapper::getName | ( | ) | const |
Return the name of the property.
Definition at line 37 of file WPropertyWrapper.cpp.
References m_prop.
int WPropertyWrapper::getSelection | ( | bool | notify = false | ) | const |
Get the (first) selected item of a selection property.
notify | If true, informs the property that it was read. |
Definition at line 72 of file WPropertyWrapper.cpp.
References m_prop.
std::string WPropertyWrapper::getString | ( | bool | notify = false | ) | const |
Get the value of a string property.
notify | If true, informs the property that it was read. |
Definition at line 57 of file WPropertyWrapper.cpp.
References m_prop.
void WPropertyWrapper::setBool | ( | bool | b | ) |
Set the value of a boolean property.
b | The new value. |
Definition at line 83 of file WPropertyWrapper.cpp.
References m_prop.
void WPropertyWrapper::setColor | ( | WColorWrapper | col | ) |
Set the color of a color property.
col | The new color. |
Definition at line 116 of file WPropertyWrapper.cpp.
References WColorWrapper::get(), and m_prop.
void WPropertyWrapper::setDouble | ( | double | d | ) |
Set the value of a double property.
d | The new value. |
Definition at line 98 of file WPropertyWrapper.cpp.
References m_prop.
void WPropertyWrapper::setFilename | ( | std::string const & | fn | ) |
Set the filename of the filename property.
fn | The new value. |
Definition at line 103 of file WPropertyWrapper.cpp.
References m_prop.
void WPropertyWrapper::setInt | ( | int | i | ) |
Set the value of an integer property.
i | The new value. |
Definition at line 88 of file WPropertyWrapper.cpp.
References m_prop.
void WPropertyWrapper::setSelection | ( | int | s | ) |
Sets the selected item of a selection.
All other items will be deselected.
s | The index of the selected item. |
Definition at line 108 of file WPropertyWrapper.cpp.
References m_prop.
void WPropertyWrapper::setString | ( | std::string const & | s | ) |
Set the value of a string property.
s | The new value. |
Definition at line 93 of file WPropertyWrapper.cpp.
References m_prop.
void WPropertyWrapper::waitForUpdate | ( | ) |
Wait for the property to update its value.
Definition at line 126 of file WPropertyWrapper.cpp.
References m_prop.
|
private |
The property.
Definition at line 182 of file WPropertyWrapper.h.
Referenced by click(), getBool(), getColor(), getDescription(), getDouble(), getFilename(), getInt(), getName(), getSelection(), getString(), setBool(), setColor(), setDouble(), setFilename(), setInt(), setSelection(), setString(), and waitForUpdate().