Cogs.Core
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.

Definition at line 18 of file Field.h.

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()

Definition at line 26 of file Field.h.

Member Function Documentation

◆ setDefault()

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

Convenience method for setting the default value of the field.

Definition at line 35 of file Field.inl.

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

◆ setRange()

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

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

Definition at line 43 of file Field.inl.

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

◆ setStep()

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

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

Definition at line 51 of file Field.inl.

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


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