RAMSES Documentation  27.0.130
Information for RAMSES users and developers
Public Types | Public Member Functions | Static Public Member Functions | List of all members
ramses::StronglyTypedValue< _baseType, _invalid, _uniqueId > Class Template Reference

Helper class to create strongly typed values out of various types. More...

#include <StronglyTypedValue.h>

Public Types

using BaseType = _baseType
 The underlying type of the class. More...
 

Public Member Functions

constexpr StronglyTypedValue (BaseType value)
 Constructor based on the underlying type. More...
 
constexpr StronglyTypedValue ()
 Default constructor with invalid value. More...
 
constexpr StronglyTypedValue (const StronglyTypedValue &other)=default
 Copy constructor. More...
 
StronglyTypedValueoperator= (const StronglyTypedValue &other)=default
 Assignment operator. More...
 
constexpr BaseType getValue () const
 Getter for retrieving the underlying value. More...
 
BaseTypegetReference ()
 Getter for a reference of the underlying value. More...
 
constexpr bool isValid () const
 Predicate to check value is unequal to Invalid() value. More...
 
constexpr bool operator== (const StronglyTypedValue &other) const
 Equals operator, compares the object to another. More...
 
constexpr bool operator!= (const StronglyTypedValue &other) const
 Not equals operator, compares the object to another. More...
 

Static Public Member Functions

static constexpr StronglyTypedValue Invalid ()
 Static Getter for Invalid. More...
 

Detailed Description

template<typename _baseType, _baseType _invalid, typename _uniqueId>
class ramses::StronglyTypedValue< _baseType, _invalid, _uniqueId >

Helper class to create strongly typed values out of various types.

Examples
ramses-example-basic-animation-realtime/src/main.cpp, ramses-example-basic-animation/src/main.cpp, ramses-example-basic-blending/src/main.cpp, ramses-example-basic-compositing/src/main.cpp, ramses-example-basic-effect-from-glsl/src/main.cpp, ramses-example-basic-file-loading/src/main.cpp, ramses-example-basic-geometry/src/main.cpp, ramses-example-basic-rendergroups/src/main.cpp, ramses-example-basic-renderpasses/src/main.cpp, ramses-example-basic-rendertarget/src/main.cpp, ramses-example-basic-scenegraph/src/main.cpp, ramses-example-basic-texturing/src/main.cpp, ramses-example-data-buffers-texture/src/main.cpp, ramses-example-data-buffers-vertices/src/main.cpp, ramses-example-dcsm-provider/src/main.cpp, ramses-example-geometry-instancing/src/main.cpp, ramses-example-interleaved-vertex-buffers/src/main.cpp, ramses-example-local-client-dcsm/src/main.cpp, ramses-example-local-client/src/main.cpp, ramses-example-local-datalink/src/main.cpp, ramses-example-local-displays/src/main.cpp, ramses-example-local-dma-offscreenbuffer/src/main.cpp, ramses-example-local-geometry-shaders/src/main.cpp, ramses-example-local-offscreenbuffer/src/main.cpp, ramses-example-local-pick-handling/src/main.cpp, ramses-example-local-scene-referencing/src/main.cpp, ramses-example-local-viewport-link/src/main.cpp, ramses-example-minimal/src/main.cpp, ramses-example-renderonce/src/main.cpp, ramses-example-text-basic/src/main.cpp, and ramses-example-text-languages/src/main.cpp.

Member Typedef Documentation

◆ BaseType

template<typename _baseType , _baseType _invalid, typename _uniqueId >
using ramses::StronglyTypedValue< _baseType, _invalid, _uniqueId >::BaseType = _baseType

The underlying type of the class.

Constructor & Destructor Documentation

◆ StronglyTypedValue() [1/3]

template<typename _baseType , _baseType _invalid, typename _uniqueId >
constexpr ramses::StronglyTypedValue< _baseType, _invalid, _uniqueId >::StronglyTypedValue ( BaseType  value)
inlineexplicitconstexpr

Constructor based on the underlying type.

Parameters
valueThe initial value of the underlying type in the object

◆ StronglyTypedValue() [2/3]

template<typename _baseType , _baseType _invalid, typename _uniqueId >
constexpr ramses::StronglyTypedValue< _baseType, _invalid, _uniqueId >::StronglyTypedValue ( )
inlineconstexpr

Default constructor with invalid value.

◆ StronglyTypedValue() [3/3]

template<typename _baseType , _baseType _invalid, typename _uniqueId >
constexpr ramses::StronglyTypedValue< _baseType, _invalid, _uniqueId >::StronglyTypedValue ( const StronglyTypedValue< _baseType, _invalid, _uniqueId > &  other)
constexprdefault

Copy constructor.

Parameters
otherThe object to be copied

Member Function Documentation

◆ getReference()

template<typename _baseType , _baseType _invalid, typename _uniqueId >
BaseType& ramses::StronglyTypedValue< _baseType, _invalid, _uniqueId >::getReference ( )
inline

Getter for a reference of the underlying value.

Returns
Reference of the underlying value of the object

◆ getValue()

template<typename _baseType , _baseType _invalid, typename _uniqueId >
constexpr BaseType ramses::StronglyTypedValue< _baseType, _invalid, _uniqueId >::getValue ( ) const
inlineconstexpr

Getter for retrieving the underlying value.

Returns
The underlying value of the object
Examples
ramses-example-basic-compositing/src/main.cpp, and ramses-example-local-pick-handling/src/main.cpp.

◆ Invalid()

template<typename _baseType , _baseType _invalid, typename _uniqueId >
static constexpr StronglyTypedValue ramses::StronglyTypedValue< _baseType, _invalid, _uniqueId >::Invalid ( )
inlinestaticconstexpr

Static Getter for Invalid.

Returns
Invalid Value of the underlying type

◆ isValid()

template<typename _baseType , _baseType _invalid, typename _uniqueId >
constexpr bool ramses::StronglyTypedValue< _baseType, _invalid, _uniqueId >::isValid ( ) const
inlineconstexpr

Predicate to check value is unequal to Invalid() value.

Returns
true when valid (i.e. not Invalid()), false otherwise

◆ operator!=()

template<typename _baseType , _baseType _invalid, typename _uniqueId >
constexpr bool ramses::StronglyTypedValue< _baseType, _invalid, _uniqueId >::operator!= ( const StronglyTypedValue< _baseType, _invalid, _uniqueId > &  other) const
inlineconstexpr

Not equals operator, compares the object to another.

Parameters
otherThe object to compare to
Returns
False if the underlying value of the object equals to the underlying value of the other.

◆ operator=()

template<typename _baseType , _baseType _invalid, typename _uniqueId >
StronglyTypedValue& ramses::StronglyTypedValue< _baseType, _invalid, _uniqueId >::operator= ( const StronglyTypedValue< _baseType, _invalid, _uniqueId > &  other)
default

Assignment operator.

Parameters
otherThe object to copy the value from
Returns
A reference to this object.

◆ operator==()

template<typename _baseType , _baseType _invalid, typename _uniqueId >
constexpr bool ramses::StronglyTypedValue< _baseType, _invalid, _uniqueId >::operator== ( const StronglyTypedValue< _baseType, _invalid, _uniqueId > &  other) const
inlineconstexpr

Equals operator, compares the object to another.

Parameters
otherThe object to compare to
Returns
True if the underlying value of the object equals to the underlying value of the other.

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