Commit 41ce9a7a authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[ADD] - added casting operator to WFlag allowing it to be casted to its flag-type.

parent 12e1f0f5
......@@ -111,6 +111,13 @@ public:
*/
virtual const T operator()() const;
/**
* Operator returns value of the flag. It does not reset the change flag.
*
* \return the value.
*/
virtual operator T() const;
/**
* Wait for the flag to change its value. For WConditionOneShot is also recognizes if the flag has changed before.
*/
......@@ -262,6 +269,12 @@ const T WFlag< T >::get() const
return m_flag;
}
template < typename T >
WFlag< T >::operator T() const
{
return get();
}
template < typename T >
void WFlag< T >::wait() const
{
......
......@@ -44,6 +44,15 @@
class OWCOMMON_EXPORT WPropertyBase: public boost::enable_shared_from_this< WPropertyBase >
{
public:
/**
* Convenience typedef for a boost::shared_ptr< WPropertyBase >
*/
typedef boost::shared_ptr< WPropertyBase > SPtr;
/**
* Convenience typedef for a boost::shared_ptr< const WPropertyBase >
*/
typedef boost::shared_ptr< const WPropertyBase > ConstSPtr;
/**
* Create an empty named property.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment