iv::FunctorField< T > Class Template Reference

#include <FunctorField.hpp>

Public Member Functions

 FunctorField (Instance *inst, std::function< void(bool real) > const &OnChange=nullptr)
 
void OnChange (std::function< void(bool real) > const &)
 
Get ()
 
void Modify (T const &)
 
- Public Member Functions inherited from iv::Field< T >
 Field (Instance *inst)
 
 ~Field ()
 
Instanceinstance () const
 
void Release_Attribute ()
 
void Assign_Attribute_R (Attr< T > *)
 
void Assign_Attribute_RW (Attr< T > *)
 
void Assign_Constant (T const &)
 
Get () const
 
void Modify (T const &)
 
- Public Member Functions inherited from iv::FieldI
 FieldI ()
 
 FieldI (FieldI const &)=delete
 
FieldIoperator= (FieldI const &)=delete
 
void Assign_AnyAttribute_R (Attribute *)
 
void Assign_AnyAttribute_RW (Attribute *)
 
std::type_index Type ()
 
Attribute::ValueMode Mode () const
 
Assignment AssignmentState () const
 

Protected Member Functions

virtual void OnChanged (bool real) override
 

Additional Inherited Members

- Public Types inherited from iv::FieldI
enum  Assignment { Assignment::Unassigned, Assignment::Constant, Assignment::Attribute_R, Assignment::Attribute_RW }
 
- Public Attributes inherited from iv::Field< T >
ClientMarker cm
 
- Protected Attributes inherited from iv::Field< T >
Instanceinst
 
std::optional< T > constant
 
Attr< T > * source_r
 
Attr< T > * source_rw
 

Detailed Description

template<class T>
class iv::FunctorField< T >

Definition at line 10 of file FunctorField.hpp.

Constructor & Destructor Documentation

◆ FunctorField()

template<class T >
iv::FunctorField< T >::FunctorField ( Instance inst,
std::function< void(bool real) > const &  OnChange = nullptr 
)

Definition at line 5 of file FunctorField.inl.

Member Function Documentation

◆ OnChange()

template<class T >
void iv::FunctorField< T >::OnChange ( std::function< void(bool real) > const &  f)

Definition at line 12 of file FunctorField.inl.

◆ Get()

template<class T >
T iv::FunctorField< T >::Get

Definition at line 20 of file FunctorField.inl.

◆ Modify()

template<class T >
void iv::FunctorField< T >::Modify ( T const &  val)

Definition at line 33 of file FunctorField.inl.

◆ OnChanged()

template<class T >
void iv::FunctorField< T >::OnChanged ( bool  real)
overrideprotectedvirtual

Called whenever result of Field<T>::Get changes (usualy when source value changes or source changes) or when mode changes (Disabled/R/RW). real True when value of Field change because value of source Attribute changed. False when it changed because it was assigned to a different Attribute.

Implements iv::Field< T >.

Definition at line 26 of file FunctorField.inl.


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