libqi-api  2.8.7.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
qi::GenericProperty Class Reference

Type-erased property, simulating a typed property but using AnyValue. More...

#include <property.hpp>

Public Member Functions

template<typename... Args>
 GenericProperty (const AutoAnyReference &defaultValue, Args &&...args)
 
template<typename... Args>
 GenericProperty (TypeInterface *type, Args &&...args)
 
GenericPropertyoperator= (const AnyValue &v)
 
FutureSync< void > setValue (AutoAnyReference value) override
 
FutureSync< void > set (const AnyValue &v) override
 
qi::Signature signature () const override
 
- Public Member Functions inherited from qi::Property< AnyValue >
 Property (Getter getter=Getter(), Setter setter=Setter(), SignalBase::OnSubscribers onsubscribe=SignalBase::OnSubscribers())
 
 Property (Strand &strand, Getter getter=Getter(), Setter setter=Setter(), SignalBase::OnSubscribers onsubscribe=SignalBase::OnSubscribers())
 
 Property (AutoAnyReference defaultValue, Getter getter=Getter(), Setter setter=Setter(), SignalBase::OnSubscribers onsubscribe=SignalBase::OnSubscribers())
 
 Property (AutoAnyReference defaultValue, Strand &strand, Getter getter=Getter(), Setter setter=Setter(), SignalBase::OnSubscribers onsubscribe=SignalBase::OnSubscribers())
 
 ~Property () override
 
Property< AnyValue > & operator= (const AnyValue &v)
 
FutureSync< AnyValueget () const override
 
FutureSync< void > set (const AnyValue &v) override
 
SignalBasesignal () override
 
FutureSync< void > setValue (AutoAnyReference value) override
 
FutureSync< AnyValuevalue () const override
 
- Public Member Functions inherited from qi::PropertyImpl< AnyValue >
 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< AnyValue > & operator= (const AnyValue &v)
 
- Public Member Functions inherited from qi::SignalF< void(const AnyValue &)>
 SignalF (OnSubscribers onSubscribers=OnSubscribers())
 
 SignalF (ExecutionContext *execContext, OnSubscribers onSubscribers)
 
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

- Public Types inherited from qi::Property< AnyValue >
using ImplType = PropertyImpl< AnyValue >
 
using Getter = typename ImplType::Getter
 
using Setter = typename ImplType::Setter
 
- Public Types inherited from qi::PropertyImpl< AnyValue >
using Setter = boost::function< bool(boost::reference_wrapper< AnyValue >, const AnyValue &)>
 
using Getter = boost::function< AnyValue(boost::reference_wrapper< const AnyValue >)>
 
using SignalType = SignalF< void(const AnyValue &)>
 
using PropertyType = AnyValue
 
- Public Types inherited from qi::SignalF< void(const AnyValue &)>
using FunctionType = void(const AnyValue &)
 
- Public Types inherited from qi::SignalBase
using OnSubscribers = boost::function< Future< void >(bool)>
 
- 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< AnyValue >
AnyValue getImpl () const
 
void setImpl (const AnyValue &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< AnyValue >
Getter _getter
 
Setter _setter
 
AnyValue _value
 
- Protected Attributes inherited from qi::SignalBase
boost::shared_ptr
< SignalBasePrivate
_p
 

Detailed Description

Type-erased property, simulating a typed property but using AnyValue.

Definition at line 237 of file property.hpp.

Constructor & Destructor Documentation

template<typename... Args>
qi::GenericProperty::GenericProperty ( const AutoAnyReference defaultValue,
Args &&...  args 
)
inlineexplicit

Constructs a property with a default value. The property type is the type of the given value.

This means that if the property is exposed, its signature will be the one of the type of the value instead of AnyValue's default signature (i.e. dynamic).

All arguments are forwarded to the constructor of the base class.

See Also
qi::Property<AnyValue>::Property(AutoAnyReference, ...)

Precondition: The value must have a valid type.

Definition at line 251 of file property.hpp.

template<typename... Args>
qi::GenericProperty::GenericProperty ( TypeInterface type,
Args &&...  args 
)
inlineexplicit

Constructs a property of the given type.

This means that if the property is exposed, its signature will be the one of the type instead of AnyValue's default signature (i.e. dynamic).

A default constructed value of the type and the rest of the arguments are forwarded to the constructor of the base class.

See Also
qi::Property<AnyValue>::Property(AutoAnyReference, ...)

Precondition: The type must be valid (not null).

Definition at line 269 of file property.hpp.

Member Function Documentation

GenericProperty& qi::GenericProperty::operator= ( const AnyValue v)
inline

Definition at line 274 of file property.hpp.

FutureSync< void > qi::GenericProperty::set ( const AnyValue v)
inlineoverridevirtual

Implements qi::PropertyImpl< AnyValue >.

Definition at line 16 of file property.hxx.

FutureSync<void> qi::GenericProperty::setValue ( AutoAnyReference  value)
inlineoverridevirtual

Implements qi::PropertyBase.

Definition at line 280 of file property.hpp.

qi::Signature qi::GenericProperty::signature ( ) const
inlineoverridevirtual

Reimplemented from qi::SignalF< void(const AnyValue &)>.

Definition at line 287 of file property.hpp.


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