aether::netcode::transcode::clamp< T, lower, upper > Struct Template Reference

clamp a number to range [lower, upper] More...

#include <transcode.hh>

Public Types

using Output = T
 
using Input = T
 

Public Member Functions

bool apply (const T &input, T &output) override final
 transform input into output More...
 
bool invert (const T &input, T &output) override final
 invert the tranformation More...
 

Detailed Description

template<typename T, int64_t lower, int64_t upper>
struct aether::netcode::transcode::clamp< T, lower, upper >

clamp a number to range [lower, upper]

Member Typedef Documentation

using aether::netcode::transcode::transform_base< T , T >::Input = T
inherited
using aether::netcode::transcode::transform_base< T , T >::Output = T
inherited

Member Function Documentation

template<typename T , int64_t lower, int64_t upper>
bool aether::netcode::transcode::clamp< T, lower, upper >::apply ( const T &  input,
T &  output 
)
inlinefinaloverridevirtual

transform input into output

Returns
whether the input is valid

Implements aether::netcode::transcode::transform_base< T, T >.

template<typename T , int64_t lower, int64_t upper>
bool aether::netcode::transcode::clamp< T, lower, upper >::invert ( const T &  input,
T &  output 
)
inlinefinaloverridevirtual

invert the tranformation

Returns
whehter input is valid

Implements aether::netcode::transcode::transform_base< T, T >.