Commit 41ce9a7a by Sebastian Eichelbaum

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

parent 12e1f0f5
......@@ -112,6 +112,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.
*/
virtual void wait() const;
......@@ -263,6 +270,12 @@ const T WFlag< T >::get() const
}
template < typename T >
WFlag< T >::operator T() const
{
return get();
}
template < typename T >
void WFlag< T >::wait() const
{
m_condition->wait();
......
......@@ -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