libqi-api  release-2.5.3-2016-11-18
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | List of all members
qi::UnsafeProperty< T > Class Template Reference

#include <property.hpp>

Public Types

using ImplType = PropertyImpl< T >
 
using Getter = typename ImplType::Getter
 
using Setter = typename ImplType::Setter
 
- Public Types inherited from qi::PropertyImpl< T >
using Setter = boost::function< bool(T &, const T &)>
 
using Getter = boost::function< T(const T &)>
 
using SignalType = SignalF< void(const T &)>
 
using PropertyType = T
 
- Public Types inherited from qi::SignalF< void(const T &)>
using FunctionType = void(const T &)
 
- Public Types inherited from qi::SignalBase
using OnSubscribers = boost::function< void(bool)>
 

Public Member Functions

 UnsafeProperty (Getter getter=Getter(), Setter setter=Setter(), SignalBase::OnSubscribers onsubscribe=SignalBase::OnSubscribers())
 
 UnsafeProperty (AutoAnyReference defaultValue, Getter getter=Getter(), Setter setter=Setter(), SignalBase::OnSubscribers onsubscribe=SignalBase::OnSubscribers())
 
UnsafeProperty< T > & operator= (const T &v)
 
FutureSync< T > get () const override
 
FutureSync< void > set (const T &v) override
 
SignalBasesignal () override
 
FutureSync< void > setValue (AutoAnyReference value) override
 
FutureSync< AnyValuevalue () const override
 
- Public Member Functions inherited from qi::PropertyImpl< T >
 PropertyImpl (Getter getter=Getter(), Setter setter=Setter(), SignalBase::OnSubscribers onsubscribe=SignalBase::OnSubscribers())
 
 PropertyImpl (AutoAnyReference defaultValue, Getter getter=Getter(), Setter setter=Setter(), SignalBase::OnSubscribers onsubscribe=SignalBase::OnSubscribers())
 
PropertyImpl< T > & operator= (const T &v)
 
- Public Member Functions inherited from qi::SignalF< void(const T &)>
 SignalF (OnSubscribers onSubscribers=OnSubscribers())
 
virtual qi::Signature signature () const
 
SignalSubscriberconnect (...)
 
- Public Member Functions inherited from qi::SignalBase
 SignalBase (const Signature &signature, OnSubscribers onSubscribers=OnSubscribers())
 
 SignalBase (OnSubscribers onSubscribers=OnSubscribers())
 
virtual ~SignalBase ()
 
template<typename F >
SignalSubscriberconnect (boost::function< F > func)
 
SignalSubscriberconnect (const SignalSubscriber &s)
 
SignalSubscriberconnect (AnyObject object, const unsigned int slot)
 
SignalSubscriberconnect (AnyObject object, const std::string &slot)
 
bool disconnectAll ()
 
bool asyncDisconnectAll ()
 
bool disconnect (const SignalLink &link)
 
bool asyncDisconnect (const SignalLink &link)
 
virtual void trigger (const GenericFunctionParameters &params, MetaCallType callType=MetaCallType_Auto)
 
void setCallType (MetaCallType callType)
 Set the MetaCallType used by operator()(). More...
 
void operator() (qi::AutoAnyReference p1=qi::AutoAnyReference(), qi::AutoAnyReference p2=qi::AutoAnyReference(), qi::AutoAnyReference p3=qi::AutoAnyReference(), qi::AutoAnyReference p4=qi::AutoAnyReference(), qi::AutoAnyReference p5=qi::AutoAnyReference(), qi::AutoAnyReference p6=qi::AutoAnyReference(), qi::AutoAnyReference p7=qi::AutoAnyReference(), qi::AutoAnyReference p8=qi::AutoAnyReference())
 Trigger the signal with given arguments, and call type set by setCallType() More...
 
std::vector< SignalSubscribersubscribers ()
 
bool hasSubscribers ()
 
void _setSignature (const Signature &s)
 
- Public Member Functions inherited from qi::PropertyBase
virtual ~PropertyBase ()=default
 

Additional Inherited Members

- Public Attributes inherited from qi::SignalBase
boost::shared_ptr
< SignalBasePrivate
_p
 
- Static Public Attributes inherited from qi::SignalBase
static const SignalLink invalidSignalLink
 
- Protected Types inherited from qi::SignalBase
using Trigger = boost::function< void(const GenericFunctionParameters &params, MetaCallType callType)>
 
- Protected Member Functions inherited from qi::PropertyImpl< T >
getImpl () const
 
void setImpl (const T &v)
 
- Protected Member Functions inherited from qi::SignalBase
void callSubscribers (const GenericFunctionParameters &params, MetaCallType callType=MetaCallType_Auto)
 
void setTriggerOverride (Trigger trigger)
 
void setOnSubscribers (OnSubscribers onSubscribers)
 
void callOnSubscribe (bool v)
 
void createNewTrackLink (int &id, SignalLink *&trackLink)
 
void disconnectTrackLink (int id)
 
- Protected Attributes inherited from qi::PropertyImpl< T >
Getter _getter
 
Setter _setter
 
_value
 

Detailed Description

template<typename T>
class qi::UnsafeProperty< T >

Povide access to a stored value and signal to connected callbacks when the value changed.

See Also
qi::Signal which implement a similar pattern but without storing the value.
Remarks
For thread-safety, consider using Property instead.

Definition at line 84 of file property.hpp.

Member Typedef Documentation

template<typename T >
using qi::UnsafeProperty< T >::Getter = typename ImplType::Getter

Definition at line 88 of file property.hpp.

template<typename T >
using qi::UnsafeProperty< T >::ImplType = PropertyImpl<T>

Definition at line 87 of file property.hpp.

template<typename T >
using qi::UnsafeProperty< T >::Setter = typename ImplType::Setter

Definition at line 89 of file property.hpp.

Constructor & Destructor Documentation

template<typename T >
qi::UnsafeProperty< T >::UnsafeProperty ( Getter  getter = Getter(),
Setter  setter = Setter(),
SignalBase::OnSubscribers  onsubscribe = SignalBase::OnSubscribers() 
)
inline

Definition at line 91 of file property.hpp.

template<typename T >
qi::UnsafeProperty< T >::UnsafeProperty ( AutoAnyReference  defaultValue,
Getter  getter = Getter(),
Setter  setter = Setter(),
SignalBase::OnSubscribers  onsubscribe = SignalBase::OnSubscribers() 
)
inline

Definition at line 96 of file property.hpp.

Member Function Documentation

template<typename T >
FutureSync< T > qi::UnsafeProperty< T >::get ( ) const
overridevirtual

Implements qi::PropertyImpl< T >.

Definition at line 73 of file property.hxx.

template<typename T >
UnsafeProperty<T>& qi::UnsafeProperty< T >::operator= ( const T &  v)
inline

Definition at line 101 of file property.hpp.

template<typename T >
FutureSync< void > qi::UnsafeProperty< T >::set ( const T &  v)
overridevirtual

Implements qi::PropertyImpl< T >.

Definition at line 79 of file property.hxx.

template<typename T >
FutureSync< void > qi::UnsafeProperty< T >::setValue ( AutoAnyReference  value)
overridevirtual

Implements qi::PropertyBase.

Definition at line 92 of file property.hxx.

template<typename T >
SignalBase* qi::UnsafeProperty< T >::signal ( )
inlineoverridevirtual

Reimplemented from qi::PropertyImpl< T >.

Definition at line 106 of file property.hpp.

template<typename T >
FutureSync< AnyValue > qi::UnsafeProperty< T >::value ( ) const
overridevirtual

Implements qi::PropertyBase.

Definition at line 86 of file property.hxx.


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