Main Page Modules Namespaces C++ Classes Compound List File List Index
TNL: tnlTypes.h File Reference

# tnlTypes.h File Reference

`#include <stdlib.h>`
`#include <new>`

## Namespaces

namespace | TNL

## Data Structures

struct | TNL::NetType
| NetType serves as a base class for all bit-compressed versions of the base types that can be transmitted using TNL's RPC mechanism. More...
struct | TNL::Int< bitCount >
| Unsigned integer bit-level RPC template wrapper. More...
struct | TNL::SignedInt< bitCount >
| Signed integer bit-level RPC template wrapper. More...
struct | TNL::Float< bitCount >
| Floating point 0. More...
struct | TNL::SignedFloat< bitCount >
| Floating point -1. More...
struct | TNL::RangedU32< rangeStart, rangeEnd >
| Unsigned ranged integer bit-level RPC template wrapper. More...

## GeneralMath Math Helpers

Some general numeric utility functions.
#define | DeclareTemplatizedMinMax(type)
bool | TNL::isPow2 (const U32 number)
| Determines if number is a power of two.
U32 | TNL::getBinLog2 (U32 value)
| Determines the binary logarithm of the input value rounded down to the nearest power of 2.
U32 | TNL::getNextBinLog2 (U32 number)
| Determines the binary logarithm of the next greater power of two of the input number.
U32 | TNL::getNextPow2 (U32 value)
| Determines the next greater power of two from the value. If the value is a power of two, it is returned.

## Defines

#define | NULL 0
#define | __EQUAL_CONST_F F32(0.000001)
| Constant float epsilon used for F32 comparisons.
#define | BIT(x) (1 << (x))

## Typedefs

typedef signed char | TNL::S8
| Compiler independent signed char (8bit integer).
typedef unsigned char | TNL::U8
| Compiler independent unsigned char (8bit integer).
typedef signed short | TNL::S16
| Compiler independent signed 16-bit short integer.
typedef unsigned short | TNL::U16
| Compiler independent unsigned 16-bit short integer.
typedef signed int | TNL::S32
| Compiler independent signed 32-bit integer.
typedef unsigned int | TNL::U32
| Compiler independent unsigned 32-bit integer.
typedef float | TNL::F32
| Compiler independent 32-bit float.
typedef double | TNL::F64
| Compiler independent 64-bit float.

## Functions

template<class T>
T * | TNL::constructInPlace (T *p)
| Constructs an object that already has memory allocated for it.
template<class T>
T * | TNL::constructInPlace (T *p, const T *copy)
| Copy constructs an object that already has memory allocated for it.
template<class T>
void | TNL::destructInPlace (T *p)
| Destructs an object without freeing the memory associated with it.
| TNL::DeclareTemplatizedMinMax (U32) DeclareTemplatizedMinMax(S32) DeclareTemplatizedMinMax(U16) DeclareTemplatizedMinMax(S16) DeclareTemplatizedMinMax(U8) DeclareTemplatizedMinMax(S8) DeclareTemplatizedMinMax(F32) DeclareTemplatizedMinMax(F64) inline void writeU32ToBuffer(U32 value

## Variables

static const F32 | TNL::FloatOne = F32(1.0)
| Constant float 1.0.
static const F32 | TNL::FloatHalf = F32(0.5)
| Constant float 0.5.
static const F32 | TNL::FloatZero = F32(0.0)
| Constant float 0.0.
static const F32 | TNL::FloatPi = F32(3.14159265358979323846)
| Constant float PI.
static const F32 | TNL::Float2Pi = F32(2.0 * 3.14159265358979323846)
| Constant float 2*PI.
static const F32 | TNL::FloatInversePi = F32(1.0 / 3.14159265358979323846)
| Constant float 1 / PI.
static const F32 | TNL::FloatHalfPi = F32(0.5 * 3.14159265358979323846)
| Constant float 1/2 * PI.
static const F32 | TNL::Float2InversePi = F32(2.0 / 3.14159265358979323846)
| Constant float 2 / PI.
static const F32 | TNL::FloatInverse2Pi = F32(0.5 / 3.14159265358979323846)
| Constant float 2 / PI.
static const F32 | TNL::FloatSqrt2 = F32(1.41421356237309504880f)
| Constant float sqrt(2).
static const F32 | TNL::FloatSqrtHalf = F32(0.7071067811865475244008443f)
| Constant float sqrt(0.5).
static const S8 | TNL::S8_MIN = S8(-128)
| Constant Min Limit S8.
static const S8 | TNL::S8_MAX = S8(127)
| Constant Max Limit S8.
static const U8 | TNL::U8_MAX = U8(255)
| Constant Max Limit U8.
static const S16 | TNL::S16_MIN = S16(-32768)
| Constant Min Limit S16.
static const S16 | TNL::S16_MAX = S16(32767)
| Constant Max Limit S16.
static const U16 | TNL::U16_MAX = U16(65535)
| Constant Max Limit U16.
static const S32 | TNL::S32_MIN = S32(-2147483647 - 1)
| Constant Min Limit S32.
static const S32 | TNL::S32_MAX = S32(2147483647)
| Constant Max Limit S32.
static const U32 | TNL::U32_MAX = U32(0xffffffff)
| Constant Max Limit U32.
static const F32 | TNL::F32_MIN = F32(1.175494351e-38F)
| Constant Min Limit F32.
static const F32 | TNL::F32_MAX = F32(3.402823466e+38F)
| Constant Max Limit F32.

## Define Documentation

#define NULL 0

#define BIT | ( | x |  | ) | (1 << (x))