#include <Attribute.hpp>

Public Types

enum  ValueMode { ValueMode::Disabled, ValueMode::Value, ValueMode::ValueModify }
 

Public Member Functions

 Attribute (ClientMarker *, AttributeEventProcessor *event_processor, bool allow_ModifyMode)
 
ClientMarkerowner () const
 
std::type_index Type ()
 
ValueMode Mode () const
 
std::any GetAny ()
 
void ModifyMode (ClientMarker *modifier, Attribute::ValueMode)
 
void ModifyAny (ClientMarker *modifier, std::any)
 
void Insert_Listener (AttributeListener *)
 
void Remove_Listener (AttributeListener *)
 

Protected Member Functions

void SetAttributeMode (ValueMode)
 
void SourceValueChanged ()
 
AttributeEventProcessorevent_processor ()
 
void event_processor (AttributeEventProcessor *)
 
void Notify_Activated ()
 
void Notify_Deactivated ()
 
virtual std::type_index Type_Impl ()=0
 
virtual std::any GetAny_Impl ()=0
 
virtual void ModifyAny_Impl (ClientMarker *modifier, std::any)=0
 
bool allow_ModifyMode ()
 

Detailed Description

Definition at line 57 of file Attribute.hpp.

Member Enumeration Documentation

◆ ValueMode

Enumerator
Disabled 

No value is present. Connected fields are disabled, input fields are greyed out.

Value 

Has a read only value assigned.

ValueModify 

Has a readable and modifiable value.

Definition at line 60 of file Attribute.hpp.

Constructor & Destructor Documentation

◆ Attribute()

iv::Attribute::Attribute ( ClientMarker cm,
AttributeEventProcessor event_processor,
bool  allow_ModifyMode 
)

event_processor This needs to be valid and preferably persistent across the whole life-cycle of the Attribute. allow_ModifyMode Set this to false when mode should be modifiable only through protected interface, set this to true and it can also be modified through public interface using Attribute::ModifyMode method. When set to true, Attribute::Modify will also change mode to ValueModify automatically.

Definition at line 22 of file Attribute.cpp.

Member Function Documentation

◆ owner()

ClientMarker * iv::Attribute::owner ( ) const

Definition at line 30 of file Attribute.cpp.

◆ Type()

std::type_index iv::Attribute::Type ( )

Definition at line 45 of file Attribute.cpp.

◆ Mode()

Attribute::ValueMode iv::Attribute::Mode ( ) const

Definition at line 72 of file Attribute.cpp.

◆ GetAny()

std::any iv::Attribute::GetAny ( )

Definition at line 50 of file Attribute.cpp.

◆ ModifyMode()

void iv::Attribute::ModifyMode ( ClientMarker modifier,
Attribute::ValueMode  mode 
)

When Attribute acts as interface between Behavior and View, then it is considered best practice to set mode from Behavior, rather than View.

Definition at line 55 of file Attribute.cpp.

◆ ModifyAny()

void iv::Attribute::ModifyAny ( ClientMarker modifier,
std::any  val 
)

If the attribute is not writable, this will have no effect (without warning). It is good practise to not call this when not knowing the type and modifiability of the field.

Definition at line 67 of file Attribute.cpp.

◆ Insert_Listener()

void iv::Attribute::Insert_Listener ( AttributeListener listener)

Definition at line 35 of file Attribute.cpp.

◆ Remove_Listener()

void iv::Attribute::Remove_Listener ( AttributeListener listener)

Definition at line 40 of file Attribute.cpp.

◆ SetAttributeMode()

void iv::Attribute::SetAttributeMode ( ValueMode  val)
protected

Definition at line 77 of file Attribute.cpp.

◆ SourceValueChanged()

void iv::Attribute::SourceValueChanged ( )
protected

Definition at line 95 of file Attribute.cpp.

◆ event_processor() [1/2]

AttributeEventProcessor * iv::Attribute::event_processor ( )
protected

Definition at line 101 of file Attribute.cpp.

◆ event_processor() [2/2]

void iv::Attribute::event_processor ( AttributeEventProcessor processor)
protected

Definition at line 106 of file Attribute.cpp.

◆ Notify_Activated()

void iv::Attribute::Notify_Activated ( )
protected

Should be called when Attr is properly connected to a AttributeEventProcessor capable of processing the events.

Definition at line 83 of file Attribute.cpp.

◆ Notify_Deactivated()

void iv::Attribute::Notify_Deactivated ( )
protected

Should be called before disconnecting Attr from its AttributeEventProcessor, losing the capability to process events.

Definition at line 89 of file Attribute.cpp.

◆ Type_Impl()

virtual std::type_index iv::Attribute::Type_Impl ( )
protectedpure virtual

◆ GetAny_Impl()

virtual std::any iv::Attribute::GetAny_Impl ( )
protectedpure virtual

◆ ModifyAny_Impl()

virtual void iv::Attribute::ModifyAny_Impl ( ClientMarker modifier,
std::any   
)
protectedpure virtual

◆ allow_ModifyMode()

bool iv::Attribute::allow_ModifyMode ( )
protected

Definition at line 111 of file Attribute.cpp.


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