VIPRA Documentation
Loading...
Searching...
No Matches
VIPRA::Behaviors::AttributeValue Struct Reference

Holds a mutable attribute value and its type. More...

#include <attributes.hpp>

Public Member Functions

void type_check (Type check) const
 Checks that the value is a given type, throws exception if not correct type.
 
template<typename value_t>
auto as () -> value_t &
 Returns a refernce to the value as a given type.
 
template<typename value_t>
auto as_ptr () const -> value_t *
 Returns a pointer to the value as a given type.
 

Public Attributes

Type type
 
void * value
 

Detailed Description

Holds a mutable attribute value and its type.

Member Function Documentation

◆ as()

template<typename value_t>
auto VIPRA::Behaviors::AttributeValue::as ( ) -> value_t&
inlinenodiscard

Returns a refernce to the value as a given type.

Template Parameters
value_t
Returns
value_t&

◆ as_ptr()

template<typename value_t>
auto VIPRA::Behaviors::AttributeValue::as_ptr ( ) const -> value_t*
inlinenodiscard

Returns a pointer to the value as a given type.

Template Parameters
value_t
Returns
value_t*

◆ type_check()

void VIPRA::Behaviors::AttributeValue::type_check ( Type check) const
inline

Checks that the value is a given type, throws exception if not correct type.

Parameters
check: type value should be

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