OpenWalnut  1.5.0dev
Public Member Functions | Private Attributes | List of all members
WPropertyWrapper Class Reference

Encapsulates a WProperty. More...

#include <WPropertyWrapper.h>

+ Collaboration diagram for WPropertyWrapper:

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< WPropertyBasem_prop
 The property. More...
 

Detailed Description

Encapsulates a WProperty.

Used to expose the properties to scripts.

Definition at line 40 of file WPropertyWrapper.h.

Constructor & Destructor Documentation

◆ WPropertyWrapper()

WPropertyWrapper::WPropertyWrapper ( std::shared_ptr< WPropertyBase prop)
explicit

Constructor.

Parameters
propThe property.

Definition at line 32 of file WPropertyWrapper.cpp.

Member Function Documentation

◆ click()

void WPropertyWrapper::click ( )

Trigger a trigger property.

Definition at line 121 of file WPropertyWrapper.cpp.

References m_prop, and WPVBaseTypes::PV_TRIGGER_TRIGGERED.

◆ getBool()

bool WPropertyWrapper::getBool ( bool  notify = false) const

Get the value of a boolean property.

Parameters
notifyIf true, informs the property that it was read.
Returns
The current value of the property.

Definition at line 47 of file WPropertyWrapper.cpp.

References m_prop.

◆ getColor()

WColorWrapper WPropertyWrapper::getColor ( bool  notify = false) const

Get the color of a color property.

Parameters
notifyIf true, informs the property that it was read.
Returns
The color of the property.

Definition at line 77 of file WPropertyWrapper.cpp.

References m_prop.

◆ getDescription()

std::string WPropertyWrapper::getDescription ( ) const

Return the description of the property.

Returns
The description of the property.

Definition at line 42 of file WPropertyWrapper.cpp.

References m_prop.

◆ getDouble()

double WPropertyWrapper::getDouble ( bool  notify = false) const

Get the value of a double property.

Parameters
notifyIf true, informs the property that it was read.
Returns
The current value of the property.

Definition at line 62 of file WPropertyWrapper.cpp.

References m_prop.

◆ getFilename()

std::string WPropertyWrapper::getFilename ( bool  notify = false) const

Get the filename of a filename property.

Parameters
notifyIf true, informs the property that it was read.
Returns
The current value of the property.

Definition at line 67 of file WPropertyWrapper.cpp.

References m_prop.

◆ getInt()

int WPropertyWrapper::getInt ( bool  notify = false) const

Get the value of an integer property.

Parameters
notifyIf true, informs the property that it was read.
Returns
The current value of the property.

Definition at line 52 of file WPropertyWrapper.cpp.

References m_prop.

◆ getName()

std::string WPropertyWrapper::getName ( ) const

Return the name of the property.

Returns
The name of the property.

Definition at line 37 of file WPropertyWrapper.cpp.

References m_prop.

◆ getSelection()

int WPropertyWrapper::getSelection ( bool  notify = false) const

Get the (first) selected item of a selection property.

Parameters
notifyIf true, informs the property that it was read.
Returns
The first of the currently selected items.

Definition at line 72 of file WPropertyWrapper.cpp.

References m_prop.

◆ getString()

std::string WPropertyWrapper::getString ( bool  notify = false) const

Get the value of a string property.

Parameters
notifyIf true, informs the property that it was read.
Returns
The current value of the property.

Definition at line 57 of file WPropertyWrapper.cpp.

References m_prop.

◆ setBool()

void WPropertyWrapper::setBool ( bool  b)

Set the value of a boolean property.

Parameters
bThe new value.

Definition at line 83 of file WPropertyWrapper.cpp.

References m_prop.

◆ setColor()

void WPropertyWrapper::setColor ( WColorWrapper  col)

Set the color of a color property.

Parameters
colThe new color.

Definition at line 116 of file WPropertyWrapper.cpp.

References WColorWrapper::get(), and m_prop.

+ Here is the call graph for this function:

◆ setDouble()

void WPropertyWrapper::setDouble ( double  d)

Set the value of a double property.

Parameters
dThe new value.

Definition at line 98 of file WPropertyWrapper.cpp.

References m_prop.

◆ setFilename()

void WPropertyWrapper::setFilename ( std::string const &  fn)

Set the filename of the filename property.

Parameters
fnThe new value.

Definition at line 103 of file WPropertyWrapper.cpp.

References m_prop.

◆ setInt()

void WPropertyWrapper::setInt ( int  i)

Set the value of an integer property.

Parameters
iThe new value.

Definition at line 88 of file WPropertyWrapper.cpp.

References m_prop.

◆ setSelection()

void WPropertyWrapper::setSelection ( int  s)

Sets the selected item of a selection.

All other items will be deselected.

Parameters
sThe index of the selected item.

Definition at line 108 of file WPropertyWrapper.cpp.

References m_prop.

◆ setString()

void WPropertyWrapper::setString ( std::string const &  s)

Set the value of a string property.

Parameters
sThe new value.

Definition at line 93 of file WPropertyWrapper.cpp.

References m_prop.

◆ waitForUpdate()

void WPropertyWrapper::waitForUpdate ( )

Wait for the property to update its value.

Definition at line 126 of file WPropertyWrapper.cpp.

References m_prop.

Member Data Documentation

◆ m_prop

std::shared_ptr< WPropertyBase > WPropertyWrapper::m_prop
private

The documentation for this class was generated from the following files: