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

Encapsulates a WProperty. More...

#include <WPropertyWrapper.h>

Public Member Functions

 WPropertyWrapper (boost::shared_ptr< WPropertyBase > prop)
 Constructor.
std::string getName () const
 Return the name of the property.
std::string getDescription () const
 Return the description of the property.
bool getBool (bool notify=false) const
 Get the value of a boolean property.
int getInt (bool notify=false) const
 Get the value of an integer property.
std::string getString (bool notify=false) const
 Get the value of a string property.
double getDouble (bool notify=false) const
 Get the value of a double property.
std::string getFilename (bool notify=false) const
 Get the filename of a filename property.
int getSelection (bool notify=false) const
 Get the (first) selected item of a selection property.
void setBool (bool b)
 Set the value of a boolean property.
void setInt (int i)
 Set the value of an integer property.
void setString (std::string const &s)
 Set the value of a string property.
void setDouble (double d)
 Set the value of a double property.
void setFilename (std::string const &fn)
 Set the filename of the filename property.
void setSelection (int s)
 Sets the selected item of a selection.
void click ()
 Trigger a trigger property.
void waitForUpdate ()
 Wait for the property to update its value.

Private Attributes

boost::shared_ptr< WPropertyBasem_prop
 The property.

Detailed Description

Encapsulates a WProperty.

Used to expose the properties to scripts.

Definition at line 39 of file WPropertyWrapper.h.

Constructor & Destructor Documentation

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

Constructor.

Parameters
propThe property.

Definition at line 32 of file WPropertyWrapper.cpp.

Member Function Documentation

void WPropertyWrapper::click ( )

Trigger a trigger property.

Definition at line 110 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.

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.

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.

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.

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.

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.

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.

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.

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.

void WPropertyWrapper::setBool ( bool  b)

Set the value of a boolean property.

Parameters
bThe new value.

Definition at line 77 of file WPropertyWrapper.cpp.

References m_prop.

void WPropertyWrapper::setDouble ( double  d)

Set the value of a double property.

Parameters
dThe new value.

Definition at line 92 of file WPropertyWrapper.cpp.

References m_prop.

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

Set the filename of the filename property.

Parameters
fnThe new value.

Definition at line 97 of file WPropertyWrapper.cpp.

References m_prop.

void WPropertyWrapper::setInt ( int  i)

Set the value of an integer property.

Parameters
iThe new value.

Definition at line 82 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.

Parameters
sThe index of the selected item.

Definition at line 102 of file WPropertyWrapper.cpp.

References m_prop.

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

Set the value of a string property.

Parameters
sThe new value.

Definition at line 87 of file WPropertyWrapper.cpp.

References m_prop.

void WPropertyWrapper::waitForUpdate ( )

Wait for the property to update its value.

Definition at line 115 of file WPropertyWrapper.cpp.

References m_prop.

Member Data Documentation

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

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