neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
neogfx::property< T, Category, Context, Calculator > Class Template Reference

#include <property.hpp>

Inheritance diagram for neogfx::property< T, Category, Context, Calculator >:
neogfx::i_property neolib::lifetime< Base > neogfx::i_property_delegate neolib::i_lifetime

Classes

struct  invalid_type
 
class  optional_proxy
 

Public Types

typedef T value_type
 
typedef Context context_type
 
typedef property_transition< T, Category, Context, Calculator > transition_type
 
typedef Category category_type
 
typedef Calculator calculator_function_type
 
- Public Types inherited from neogfx::i_property
typedef i_property abstract_type
 
- Public Types inherited from neolib::lifetime< Base >
typedef neolib::destroyed_flag destroyed_flag
 

Public Member Functions

 define_declared_event (PropertyChanged, property_changed, const property_variant &) define_declared_event(PropertyChangedFromTo
 
const property_variant const property_variantdefine_event (Changed, changed, value_type const &) define_event(ChangedFromTo
 
 property (i_property_owner &aOwner, std::string const &aName)
 
 property (i_property_owner &aOwner, std::string const &aName, calculator_function_type aCalculator)
 
 property (i_property_owner &aOwner, std::string const &aName, const T &aValue)
 
 property (i_property_owner &aOwner, std::string const &aName, calculator_function_type aCalculator, const T &aValue)
 
property_variant get (const i_property &aProperty) const final
 
i_property_ownerowner () const final
 
const stringname () const final
 
const std::type_info & type () const final
 
const std::type_info & category () const final
 
bool optional () const final
 
property_variant get_as_variant () const final
 
void set_from_variant (const property_variant &aValue) final
 
bool read_only () const final
 
void set_read_only (bool aReadOnly) final
 
bool transition_set () const final
 
transition_typetransition () const final
 
void set_transition (i_animator &aAnimator, easing aEasingFunction, double aDuration, bool aEnabled=true) final
 
void clear_transition () final
 
bool transition_suppressed () const final
 
void suppress_transition (bool aSuppress) final
 
bool has_delegate () const final
 
i_property_delegate const & delegate () const final
 
i_property_delegatedelegate () final
 
void set_delegate (i_property_delegate &aDelegate) final
 
void unset_delegate () final
 
value_type const & value () const
 
value_type const & effective_value () const
 
template<typename T2 >
self_type & assign (T2 &&aValue, bool aOwnerNotify=true, bool aDiscardPreviousValue=false)
 
template<typename T2 >
self_type & operator= (T2 &&aValue)
 
 operator value_type const & () const
 
template<typename SFINAE = optional_proxy<const self_type>>
const std::enable_if< neolib::is_optional_v< T >, SFINAE >::type operator* () const
 
template<typename SFINAE = optional_proxy<self_type>>
std::enable_if< neolib::is_optional_v< T >, SFINAE >::type operator* ()
 
template<typename SFINAE = optional_proxy<const self_type>>
const std::enable_if< neolib::is_optional_v< T >, SFINAE >::type operator-> () const
 
template<typename SFINAE = optional_proxy<self_type>>
std::enable_if< neolib::is_optional_v< T >, SFINAE >::type operator-> ()
 
template<typename T >
bool operator== (const T &aRhs) const
 
template<typename T >
bool operator!= (const T &aRhs) const
 
template<typename T >
bool operator== (const neolib::optional< T > &aRhs) const
 
template<typename T >
bool operator!= (const neolib::optional< T > &aRhs) const
 
- Public Member Functions inherited from neogfx::i_property
 declare_event (property_changed, const property_variant &) declare_event(property_changed_from_to
 
virtual ~i_property ()=default
 
template<typename T >
const T & get () const
 
template<typename T >
T & get ()
 
template<typename Context , typename Callable , typename... Args>
auto calculate (Args &&... aArgs) const
 
- Public Member Functions inherited from neogfx::i_property_delegate
virtual ~i_property_delegate ()=default
 
- Public Member Functions inherited from neolib::lifetime< Base >
 lifetime (lifetime_state aState=lifetime_state::Alive)
 
virtual ~lifetime ()
 
lifetime_state object_state () const final
 
std::shared_ptr< std::atomic< lifetime_state > > object_state_ptr () const final
 
bool is_creating () const final
 
bool is_alive () const final
 
bool is_destroying () const final
 
bool is_destroyed () const final
 
void set_alive () override
 
void set_destroying () override
 
void set_destroyed () override
 
- Public Member Functions inherited from neolib::i_lifetime
virtual ~i_lifetime ()=default
 

Public Attributes

 property_changed_from_to
 
const property_variant const property_variant changed_from_to
 

Protected Member Functions

const void * data () const final
 
void * data () final
 
void *const * calculator_function () const final
 

Friends

template<typename , typename , class , typename >
class property_transition
 

Detailed Description

template<typename T, typename Category, class Context, typename Calculator = T(*)()>
class neogfx::property< T, Category, Context, Calculator >

Definition at line 134 of file property.hpp.

Member Typedef Documentation

◆ calculator_function_type

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
typedef Calculator neogfx::property< T, Category, Context, Calculator >::calculator_function_type

Definition at line 152 of file property.hpp.

◆ category_type

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
typedef Category neogfx::property< T, Category, Context, Calculator >::category_type

Definition at line 151 of file property.hpp.

◆ context_type

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
typedef Context neogfx::property< T, Category, Context, Calculator >::context_type

Definition at line 141 of file property.hpp.

◆ transition_type

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
typedef property_transition<T, Category, Context, Calculator> neogfx::property< T, Category, Context, Calculator >::transition_type

Definition at line 142 of file property.hpp.

◆ value_type

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
typedef T neogfx::property< T, Category, Context, Calculator >::value_type

Definition at line 140 of file property.hpp.

Constructor & Destructor Documentation

◆ property() [1/4]

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
neogfx::property< T, Category, Context, Calculator >::property ( i_property_owner aOwner,
std::string const &  aName 
)
inline

Definition at line 184 of file property.hpp.

◆ property() [2/4]

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
neogfx::property< T, Category, Context, Calculator >::property ( i_property_owner aOwner,
std::string const &  aName,
calculator_function_type  aCalculator 
)
inline

Definition at line 188 of file property.hpp.

◆ property() [3/4]

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
neogfx::property< T, Category, Context, Calculator >::property ( i_property_owner aOwner,
std::string const &  aName,
const T &  aValue 
)
inline

Definition at line 192 of file property.hpp.

◆ property() [4/4]

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
neogfx::property< T, Category, Context, Calculator >::property ( i_property_owner aOwner,
std::string const &  aName,
calculator_function_type  aCalculator,
const T &  aValue 
)
inline

Definition at line 196 of file property.hpp.

Member Function Documentation

◆ assign()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
template<typename T2 >
self_type & neogfx::property< T, Category, Context, Calculator >::assign ( T2 &&  aValue,
bool  aOwnerNotify = true,
bool  aDiscardPreviousValue = false 
)
inline

Definition at line 351 of file property.hpp.

◆ calculator_function()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
void *const * neogfx::property< T, Category, Context, Calculator >::calculator_function ( ) const
inlinefinalprotectedvirtual

Implements neogfx::i_property.

Definition at line 434 of file property.hpp.

◆ category()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
const std::type_info & neogfx::property< T, Category, Context, Calculator >::category ( ) const
inlinefinalvirtual

Implements neogfx::i_property.

Definition at line 219 of file property.hpp.

◆ clear_transition()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
void neogfx::property< T, Category, Context, Calculator >::clear_transition ( )
inlinefinalvirtual

Implements neogfx::i_property.

Definition at line 271 of file property.hpp.

◆ data() [1/2]

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
const void * neogfx::property< T, Category, Context, Calculator >::data ( ) const
inlinefinalprotectedvirtual

Implements neogfx::i_property.

Definition at line 420 of file property.hpp.

◆ data() [2/2]

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
void * neogfx::property< T, Category, Context, Calculator >::data ( )
inlinefinalprotectedvirtual

Implements neogfx::i_property.

Definition at line 427 of file property.hpp.

◆ define_declared_event()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
neogfx::property< T, Category, Context, Calculator >::define_declared_event ( PropertyChanged  ,
property_changed  ,
const property_variant  
)

◆ define_event()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
const property_variant const property_variant & neogfx::property< T, Category, Context, Calculator >::define_event ( Changed  ,
changed  ,
value_type const &   
)

◆ delegate() [1/2]

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
i_property_delegate const & neogfx::property< T, Category, Context, Calculator >::delegate ( ) const
inlinefinalvirtual

Implements neogfx::i_property.

Definition at line 292 of file property.hpp.

◆ delegate() [2/2]

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
i_property_delegate & neogfx::property< T, Category, Context, Calculator >::delegate ( )
inlinefinalvirtual

Implements neogfx::i_property.

Definition at line 298 of file property.hpp.

◆ effective_value()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
value_type const & neogfx::property< T, Category, Context, Calculator >::effective_value ( ) const
inline

Definition at line 343 of file property.hpp.

◆ get()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
property_variant neogfx::property< T, Category, Context, Calculator >::get ( const i_property< T, Category, Context, Calculator > &  aProperty) const
inlinefinalvirtual

Implements neogfx::i_property_delegate.

Definition at line 201 of file property.hpp.

◆ get_as_variant()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
property_variant neogfx::property< T, Category, Context, Calculator >::get_as_variant ( ) const
inlinefinalvirtual

Implements neogfx::i_property.

Definition at line 227 of file property.hpp.

◆ has_delegate()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
bool neogfx::property< T, Category, Context, Calculator >::has_delegate ( ) const
inlinefinalvirtual

Implements neogfx::i_property.

Definition at line 288 of file property.hpp.

◆ name()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
const string & neogfx::property< T, Category, Context, Calculator >::name ( ) const
inlinefinalvirtual

Implements neogfx::i_property.

Definition at line 211 of file property.hpp.

◆ operator value_type const &()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
neogfx::property< T, Category, Context, Calculator >::operator value_type const & ( ) const
inline

Definition at line 375 of file property.hpp.

◆ operator!=() [1/2]

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
template<typename T >
bool neogfx::property< T, Category, Context, Calculator >::operator!= ( const neolib::optional< T > &  aRhs) const
inline

Definition at line 415 of file property.hpp.

◆ operator!=() [2/2]

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
template<typename T >
bool neogfx::property< T, Category, Context, Calculator >::operator!= ( const T &  aRhs) const
inline

Definition at line 405 of file property.hpp.

◆ operator*() [1/2]

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
template<typename SFINAE = optional_proxy<self_type>>
std::enable_if< neolib::is_optional_v< T >, SFINAE >::type neogfx::property< T, Category, Context, Calculator >::operator* ( )
inline

Definition at line 385 of file property.hpp.

◆ operator*() [2/2]

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
template<typename SFINAE = optional_proxy<const self_type>>
const std::enable_if< neolib::is_optional_v< T >, SFINAE >::type neogfx::property< T, Category, Context, Calculator >::operator* ( ) const
inline

Definition at line 380 of file property.hpp.

◆ operator->() [1/2]

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
template<typename SFINAE = optional_proxy<self_type>>
std::enable_if< neolib::is_optional_v< T >, SFINAE >::type neogfx::property< T, Category, Context, Calculator >::operator-> ( )
inline

Definition at line 395 of file property.hpp.

◆ operator->() [2/2]

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
template<typename SFINAE = optional_proxy<const self_type>>
const std::enable_if< neolib::is_optional_v< T >, SFINAE >::type neogfx::property< T, Category, Context, Calculator >::operator-> ( ) const
inline

Definition at line 390 of file property.hpp.

◆ operator=()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
template<typename T2 >
self_type & neogfx::property< T, Category, Context, Calculator >::operator= ( T2 &&  aValue)
inline

Definition at line 371 of file property.hpp.

◆ operator==() [1/2]

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
template<typename T >
bool neogfx::property< T, Category, Context, Calculator >::operator== ( const neolib::optional< T > &  aRhs) const
inline

Definition at line 410 of file property.hpp.

◆ operator==() [2/2]

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
template<typename T >
bool neogfx::property< T, Category, Context, Calculator >::operator== ( const T &  aRhs) const
inline

Definition at line 400 of file property.hpp.

◆ optional()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
bool neogfx::property< T, Category, Context, Calculator >::optional ( ) const
inlinefinalvirtual

Implements neogfx::i_property.

Definition at line 223 of file property.hpp.

◆ owner()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
i_property_owner & neogfx::property< T, Category, Context, Calculator >::owner ( ) const
inlinefinalvirtual

Implements neogfx::i_property.

Definition at line 206 of file property.hpp.

◆ read_only()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
bool neogfx::property< T, Category, Context, Calculator >::read_only ( ) const
inlinefinalvirtual

Implements neogfx::i_property.

Definition at line 249 of file property.hpp.

◆ set_delegate()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
void neogfx::property< T, Category, Context, Calculator >::set_delegate ( i_property_delegate aDelegate)
inlinefinalvirtual

Implements neogfx::i_property.

Definition at line 302 of file property.hpp.

◆ set_from_variant()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
void neogfx::property< T, Category, Context, Calculator >::set_from_variant ( const property_variant aValue)
inlinefinalvirtual

Implements neogfx::i_property.

Definition at line 239 of file property.hpp.

◆ set_read_only()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
void neogfx::property< T, Category, Context, Calculator >::set_read_only ( bool  aReadOnly)
inlinefinalvirtual

Implements neogfx::i_property.

Definition at line 253 of file property.hpp.

◆ set_transition()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
void neogfx::property< T, Category, Context, Calculator >::set_transition ( i_animator aAnimator,
easing  aEasingFunction,
double  aDuration,
bool  aEnabled = true 
)
inlinefinalvirtual

Implements neogfx::i_property.

Definition at line 267 of file property.hpp.

◆ suppress_transition()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
void neogfx::property< T, Category, Context, Calculator >::suppress_transition ( bool  aSuppress)
inlinefinalvirtual

Implements neogfx::i_property.

Definition at line 279 of file property.hpp.

◆ transition()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
transition_type & neogfx::property< T, Category, Context, Calculator >::transition ( ) const
inlinefinalvirtual

Implements neogfx::i_property.

Definition at line 261 of file property.hpp.

◆ transition_set()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
bool neogfx::property< T, Category, Context, Calculator >::transition_set ( ) const
inlinefinalvirtual

Implements neogfx::i_property.

Definition at line 257 of file property.hpp.

◆ transition_suppressed()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
bool neogfx::property< T, Category, Context, Calculator >::transition_suppressed ( ) const
inlinefinalvirtual

Implements neogfx::i_property.

Definition at line 275 of file property.hpp.

◆ type()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
const std::type_info & neogfx::property< T, Category, Context, Calculator >::type ( ) const
inlinefinalvirtual

Implements neogfx::i_property.

Definition at line 215 of file property.hpp.

◆ unset_delegate()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
void neogfx::property< T, Category, Context, Calculator >::unset_delegate ( )
inlinefinalvirtual

Implements neogfx::i_property.

Definition at line 306 of file property.hpp.

◆ value()

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
value_type const & neogfx::property< T, Category, Context, Calculator >::value ( ) const
inline

Definition at line 311 of file property.hpp.

Friends And Related Symbol Documentation

◆ property_transition

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
template<typename , typename , class , typename >
friend class property_transition
friend

Definition at line 138 of file property.hpp.

Member Data Documentation

◆ changed_from_to

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
const property_variant const property_variant neogfx::property< T, Category, Context, Calculator >::changed_from_to

Definition at line 147 of file property.hpp.

◆ property_changed_from_to

template<typename T , typename Category , class Context , typename Calculator = T(*)()>
neogfx::property< T, Category, Context, Calculator >::property_changed_from_to

Definition at line 145 of file property.hpp.


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