aether::netcode::transcode::Rebase< T, old_base > Struct Template Reference

Transform a number from [old_base, +inf) to [0, +inf). By subtracting old_base 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, T old_base>
struct aether::netcode::transcode::Rebase< T, old_base >

Transform a number from [old_base, +inf) to [0, +inf). By subtracting old_base

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 , T old_base>
bool aether::netcode::transcode::Rebase< T, old_base >::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 , T old_base>
bool aether::netcode::transcode::Rebase< T, old_base >::invert ( const T &  input,
T &  output 
)
inlinefinaloverridevirtual

invert the tranformation

Returns
whehter input is valid

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