#include <Field.hpp>

Public Member Functions

 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
 

Public Attributes

ClientMarker cm
 

Protected Member Functions

virtual void OnChanged (bool real)=0
 

Protected Attributes

Instanceinst
 
std::optional< T > constant
 
Attr< T > * source_r
 
Attr< T > * source_rw
 

Additional Inherited Members

- Public Types inherited from iv::FieldI
enum  Assignment { Assignment::Unassigned, Assignment::Constant, Assignment::Attribute_R, Assignment::Attribute_RW }
 

Detailed Description

template<class T>
class iv::Field< T >

Definition at line 50 of file Field.hpp.

Constructor & Destructor Documentation

◆ Field()

template<class T >
iv::Field< T >::Field ( Instance inst)

Definition at line 6 of file Field.inl.

◆ ~Field()

template<class T >
iv::Field< T >::~Field

Definition at line 17 of file Field.inl.

Member Function Documentation

◆ instance()

template<class T >
Instance * iv::Field< T >::instance

Definition at line 24 of file Field.inl.

◆ Release_Attribute()

template<class T >
void iv::Field< T >::Release_Attribute

Releases currently assigned attribute or constant value.

Definition at line 46 of file Field.inl.

◆ Assign_Attribute_R()

template<class T >
void iv::Field< T >::Assign_Attribute_R ( Attr< T > *  src)

Sets mode to Mode::Value. Releases any previously assigned attributes and constant values.

Definition at line 30 of file Field.inl.

◆ Assign_Attribute_RW()

template<class T >
void iv::Field< T >::Assign_Attribute_RW ( Attr< T > *  attr)

Sets mode to Mode::ValueModify. Releases any previously assigned attributes and constant values.

Definition at line 154 of file Field.inl.

◆ Assign_Constant()

template<class T >
void iv::Field< T >::Assign_Constant ( T const &  value)

Definition at line 59 of file Field.inl.

◆ Get()

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

Returns current value of source Attribute. Or returns default value (created using default constructor), if no attribute or constant value is assigned (mode Mode::Disabled).

Definition at line 75 of file Field.inl.

◆ Modify()

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

Field can call this to modify value of source Attribute. Call this in reaction to user changing value of the field. This will issue call to Field<T>::OnChanged on this instance.

Definition at line 170 of file Field.inl.

◆ OnChanged()

template<class T >
virtual void iv::Field< T >::OnChanged ( bool  real)
protectedpure virtual

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.

Implemented in iv::FunctorActivatorField, and iv::FunctorField< T >.

Member Data Documentation

◆ cm

template<class T >
ClientMarker iv::Field< T >::cm

Definition at line 53 of file Field.hpp.

◆ inst

template<class T >
Instance* iv::Field< T >::inst
protected

Definition at line 115 of file Field.hpp.

◆ constant

template<class T >
std::optional< T > iv::Field< T >::constant
protected

Definition at line 116 of file Field.hpp.

◆ source_r

template<class T >
Attr< T >* iv::Field< T >::source_r
protected

Definition at line 117 of file Field.hpp.

◆ source_rw

template<class T >
Attr< T >* iv::Field< T >::source_rw
protected

Definition at line 118 of file Field.hpp.


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