Cogs.Foundation
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Cogs::Reflection::FieldWrapper< T, U > Struct Template Reference

Convenience wrapper for adding attributes during field creation in a type safe manner. More...

#include <Field.h>

Inheritance diagram for Cogs::Reflection::FieldWrapper< T, U >:

Public Member Functions

template<typename ClassType , typename FieldType >
 FieldWrapper (const Name &name, FieldType ClassType::*field)
 Construct the field wrapper, forwarding arguments to the underlying field.
 
FieldWrappersetDefault (U value)
 Convenience method for setting the default value of the field.
 
FieldWrappersetRange (U min, U max)
 Convenience method for setting the valid value range of the field.
 
FieldWrappersetStep (U step)
 Convenience method for setting the valid value step of the field.
 

Detailed Description

template<typename T, typename U>
struct Cogs::Reflection::FieldWrapper< T, U >

Convenience wrapper for adding attributes during field creation in a type safe manner.

Template Parameters
TField type, used to convert the wrapper back to a field trivially.
UValue type, used to provide type safe attribute wrappers.

Constructor & Destructor Documentation

◆ FieldWrapper()

template<typename T , typename U >
template<typename ClassType , typename FieldType >
Cogs::Reflection::FieldWrapper< T, U >::FieldWrapper ( const Name name,
FieldType ClassType::*  field 
)
inline

Construct the field wrapper, forwarding arguments to the underlying field.

See also
Field::Field()

Member Function Documentation

◆ setDefault()

template<typename T , typename U >
FieldWrapper< T, U > & Cogs::Reflection::FieldWrapper< T, U >::setDefault ( U  value)

Convenience method for setting the default value of the field.

References Cogs::Reflection::Field::add().

◆ setRange()

template<typename T , typename U >
FieldWrapper< T, U > & Cogs::Reflection::FieldWrapper< T, U >::setRange ( U  min,
U  max 
)

Convenience method for setting the valid value range of the field.

References Cogs::Reflection::Field::add().

◆ setStep()

template<typename T , typename U >
FieldWrapper< T, U > & Cogs::Reflection::FieldWrapper< T, U >::setStep ( U  step)

Convenience method for setting the valid value step of the field.

References Cogs::Reflection::Field::add().


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