libqi-api  2.8.7.4
 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(boost::reference_wrapper< T >, const T &)>
 
using Getter = boost::function< T(boost::reference_wrapper< 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< Future< 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 (ExecutionContext *execContext, 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 (AutoAnyReference defaultValue, ExecutionContext *execContext=nullptr, 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())
 
 SignalF (ExecutionContext *execContext, OnSubscribers onSubscribers)
 
virtual qi::Signature signature () const
 
SignalSubscriber connect (...)
 
- Public Member Functions inherited from qi::SignalBase
 SignalBase (const Signature &signature, OnSubscribers onSubscribers=OnSubscribers())
 
 SignalBase (const Signature &signature, ExecutionContext *execContext, OnSubscribers onSubscribers=OnSubscribers())
 
 SignalBase (OnSubscribers onSubscribers=OnSubscribers())
 
 SignalBase (ExecutionContext *execContext, OnSubscribers onSubscribers=OnSubscribers())
 
 SignalBase (const SignalBase &)=delete
 SignalBase is not copyable, since subscriptions should not be duplicated. More...
 
SignalBaseoperator= (const SignalBase &)=delete
 
virtual ~SignalBase ()
 
template<typename F >
SignalSubscriber connect (boost::function< F > func)
 
SignalSubscriber connect (AnyObject object, const unsigned int slot)
 
SignalSubscriber connect (AnyObject object, const std::string &slot)
 
SignalSubscriber connect (const SignalSubscriber &s)
 The following overloads are the lowest-level. More...
 
Future< SignalSubscriber > connectAsync (const SignalSubscriber &)
 
bool disconnectAll ()
 
Future< bool > disconnectAllAsync ()
 
bool asyncDisconnectAll ()
 
bool disconnect (const SignalLink &link)
 
Future< bool > disconnectAsync (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< SignalSubscriber > subscribers ()
 
bool hasSubscribers ()
 
void setOnSubscribers (OnSubscribers onSubscribers)
 
void _setSignature (const Signature &s)
 
- Public Member Functions inherited from qi::PropertyBase
 PropertyBase ()=default
 
 PropertyBase (const PropertyBase &)=delete
 
PropertyBaseoperator= (const PropertyBase &)=delete
 
virtual ~PropertyBase ()=default
 

Additional Inherited Members

- 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 callOnSubscribe (bool v)
 
void createNewTrackLink (int &id, SignalLink *&trackLink)
 
void disconnectTrackLink (int id)
 
ExecutionContextexecutionContext () const
 
void clearExecutionContext ()
 
- Protected Attributes inherited from qi::PropertyImpl< T >
Getter _getter
 
Setter _setter
 
_value
 
- Protected Attributes inherited from qi::SignalBase
boost::shared_ptr
< SignalBasePrivate
_p
 

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 123 of file property.hpp.

Member Typedef Documentation

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

Definition at line 127 of file property.hpp.

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

Definition at line 126 of file property.hpp.

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

Definition at line 128 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 130 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 135 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 99 of file property.hxx.

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

Definition at line 140 of file property.hpp.

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

Implements qi::PropertyImpl< T >.

Definition at line 105 of file property.hxx.

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

Implements qi::PropertyBase.

Definition at line 118 of file property.hxx.

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

Reimplemented from qi::PropertyImpl< T >.

Definition at line 145 of file property.hpp.

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

Implements qi::PropertyBase.

Definition at line 112 of file property.hxx.


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