Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ion::gfx::ResourceHolder::RangedField< T > Class Template Reference

A Field that has a limited valid range of values. More...

#include "resourceholder.h"

Inheritance diagram for ion::gfx::ResourceHolder::RangedField< T >:
Collaboration diagram for ion::gfx::ResourceHolder::RangedField< T >:

Public Member Functions

 RangedField (const int change_bit, const T &initial_value, const T &min_value, const T &max_value, ResourceHolder *holder)
 
 ~RangedField () override
 
bool IsValid (const T &value) override
 Check if the proposed value falls within the correct range. More...
 
const TGet () const
 Gets a const version of the current value. More...
 
TGetMutable ()
 Gets an editable version of the current value. More...
 
bool Set (const T &value)
 Sets the value of the Field if it is valid and tells the resource what has changed. More...
 
int GetBit () const
 Get the change bit. More...
 

Protected Member Functions

void OnChanged ()
 
void OnChanged (const int bit)
 Trigger a change for a specific bit. More...
 

Detailed Description

template<typename T>
class ion::gfx::ResourceHolder::RangedField< T >

A Field that has a limited valid range of values.

Definition at line 186 of file resourceholder.h.

Constructor & Destructor Documentation

template<typename T >
ion::gfx::ResourceHolder::RangedField< T >::RangedField ( const int  change_bit,
const T initial_value,
const T min_value,
const T max_value,
ResourceHolder holder 
)
inline

Definition at line 188 of file resourceholder.h.

template<typename T >
ion::gfx::ResourceHolder::RangedField< T >::~RangedField ( )
inlineoverride

Definition at line 196 of file resourceholder.h.

Member Function Documentation

template<typename T>
const T& ion::gfx::ResourceHolder::Field< T >::Get ( ) const
inlineinherited

Gets a const version of the current value.

Definition at line 157 of file resourceholder.h.

int ion::gfx::ResourceHolder::FieldBase::GetBit ( ) const
inlineinherited

Get the change bit.

Definition at line 102 of file resourceholder.h.

template<typename T>
T* ion::gfx::ResourceHolder::Field< T >::GetMutable ( )
inlineinherited

Gets an editable version of the current value.

Since the caller could do anything with the reference, also notify the resource.

Definition at line 161 of file resourceholder.h.

template<typename T >
bool ion::gfx::ResourceHolder::RangedField< T >::IsValid ( const T value)
inlineoverridevirtual

Check if the proposed value falls within the correct range.

Reimplemented from ion::gfx::ResourceHolder::Field< T >.

Definition at line 199 of file resourceholder.h.

void ion::gfx::ResourceHolder::FieldBase::OnChanged ( )
inlineprotectedinherited

Definition at line 113 of file resourceholder.h.

void ion::gfx::ResourceHolder::FieldBase::OnChanged ( const int  bit)
inlineprotectedinherited

Trigger a change for a specific bit.

Definition at line 121 of file resourceholder.h.

template<typename T>
bool ion::gfx::ResourceHolder::Field< T >::Set ( const T value)
inlineinherited

Sets the value of the Field if it is valid and tells the resource what has changed.

If the value is not valid, an error message is logged. Returns whether the set occurred.

Definition at line 169 of file resourceholder.h.


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