libqi-api  2.8.7.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
qi::PropertyImpl< T > Class Template Referenceabstract

#include <property.hpp>

Public Types

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

 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())
 
virtual FutureSync< T > get () const =0
 
virtual FutureSync< void > set (const T &v)=0
 
PropertyImpl< T > & operator= (const T &v)
 
SignalBasesignal () override
 
- 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
 
virtual FutureSync< void > setValue (AutoAnyReference value)=0
 
virtual FutureSync< AnyValuevalue () const =0
 

Protected Member Functions

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

Getter _getter
 
Setter _setter
 
_value
 
- Protected Attributes inherited from qi::SignalBase
boost::shared_ptr
< SignalBasePrivate
_p
 

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)>
 

Detailed Description

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

Definition at line 65 of file property.hpp.

Member Typedef Documentation

template<typename T>
using qi::PropertyImpl< T >::Getter = boost::function<T(boost::reference_wrapper<const T>)>

Definition at line 72 of file property.hpp.

template<typename T>
using qi::PropertyImpl< T >::PropertyType = T

Definition at line 74 of file property.hpp.

template<typename T>
using qi::PropertyImpl< T >::Setter = boost::function<bool (boost::reference_wrapper<T>, const T&)>

Setter called with storage containing old value, and new value Returns true to invoke subscribers, false to 'abort' the update.

Definition at line 71 of file property.hpp.

template<typename T>
using qi::PropertyImpl< T >::SignalType = SignalF<void(const T&)>

Definition at line 73 of file property.hpp.

Constructor & Destructor Documentation

template<typename T >
qi::PropertyImpl< T >::PropertyImpl ( Getter  getter = Getter(),
Setter  setter = Setter(),
SignalBase::OnSubscribers  onsubscribe = SignalBase::OnSubscribers() 
)
Parameters
gettervalue getter, default to reading _value.
settervalue setter. If it returns false, update operation will be silently aborted (subscribers will not be called).
onsubscribecallback to call when subscribers connect or disconnect from the property.

Definition at line 29 of file property.hxx.

template<typename T >
qi::PropertyImpl< T >::PropertyImpl ( ExecutionContext execContext,
Getter  getter = Getter(),
Setter  setter = Setter(),
SignalBase::OnSubscribers  onsubscribe = SignalBase::OnSubscribers() 
)

This overload takes an ExecutionContext pointer that will be passed to the Signal constructor.

Definition at line 38 of file property.hxx.

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

Definition at line 49 of file property.hxx.

template<typename T >
qi::PropertyImpl< T >::PropertyImpl ( AutoAnyReference  defaultValue,
ExecutionContext execContext = nullptr,
Getter  getter = Getter(),
Setter  setter = Setter(),
SignalBase::OnSubscribers  onsubscribe = SignalBase::OnSubscribers() 
)

This overload takes an ExecutionContext pointer that will be passed to the Signal constructor.

Definition at line 60 of file property.hxx.

Member Function Documentation

template<typename T>
virtual FutureSync<T> qi::PropertyImpl< T >::get ( ) const
pure virtual
template<typename T >
T qi::PropertyImpl< T >::getImpl ( ) const
protected

Definition at line 73 of file property.hxx.

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

Definition at line 104 of file property.hpp.

template<typename T>
virtual FutureSync<void> qi::PropertyImpl< T >::set ( const T &  v)
pure virtual
template<typename T>
void qi::PropertyImpl< T >::setImpl ( const T &  v)
protected

Definition at line 81 of file property.hxx.

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

Member Data Documentation

template<typename T>
Getter qi::PropertyImpl< T >::_getter
protected

Definition at line 109 of file property.hpp.

template<typename T>
Setter qi::PropertyImpl< T >::_setter
protected

Definition at line 110 of file property.hpp.

template<typename T>
T qi::PropertyImpl< T >::_value
protected

Definition at line 111 of file property.hpp.


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