aether::netcode::transcode::to_integer< F, I, > Struct Template Reference

Cast a float point number to integer. More...

#include <transcode.hh>

Public Types

using Output = I
 
using Input = F
 

Public Member Functions

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

Detailed Description

template<typename F, typename I, std::enable_if_t< std::is_integral< I >::value &&std::is_floating_point< F >::value, int > = 0>
struct aether::netcode::transcode::to_integer< F, I, >

Cast a float point number to integer.

Member Typedef Documentation

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

Member Function Documentation

template<typename F , typename I , std::enable_if_t< std::is_integral< I >::value &&std::is_floating_point< F >::value, int > = 0>
bool aether::netcode::transcode::to_integer< F, I, >::apply ( const F &  input,
I &  output 
)
inlinefinaloverridevirtual

transform input into output

Returns
whether the input is valid

Implements aether::netcode::transcode::transform_base< F, I >.

template<typename F , typename I , std::enable_if_t< std::is_integral< I >::value &&std::is_floating_point< F >::value, int > = 0>
bool aether::netcode::transcode::to_integer< F, I, >::invert ( const I &  input,
F &  output 
)
inlinefinaloverridevirtual

invert the tranformation

Returns
whehter input is valid

Implements aether::netcode::transcode::transform_base< F, I >.