Files | Namespaces | Classes | Macros | Typedefs | Enumerations | Functions | Variables
ionCore

Description

ionCore is the basis for all other modules, a set of boilerplate functions, classes, and templates.

Files

file  ionClass.h
 Methods and classes for rudimentary reflection and other class related functionality.
 
file  ionClass.h
 Methods and classes for rudimentary reflection and other class related functionality.
 
file  ionContainer.h
 Helper functions for working with std containers such as map and vector.
 
file  ionLogger.h
 Logging class.
 
file  ionSmartPointer.h
 Brings some standard library pointer classes into ion namespace.
 
file  ionTypes.h
 Defines typedefs for integer and floating point types.
 
file  ionUtils.h
 General helper functions.
 

Namespaces

 ion::Constants32
 
 ion::Constants64
 

Classes

class  ion::Bitwise
 Tools for bitwise operations. More...
 
struct  ion::Color::Basic
 Some very basic colors. More...
 
struct  ion::Color::Full< T >
 Determines the maximum color value for a given type. More...
 
struct  ion::Color::Convert< T, U >
 Implements a conversion between two color types. More...
 
class  ion::color3< T >
 Customized variant of vec3 that intelligently handles conversion between floating point and integer colors. More...
 
class  ion::color4< T >
 Customized variant of vec4 that intelligently handles conversion between floating point and integer colors. More...
 
class  ion::File
 Helper methods for dealing with files. More...
 
class  ion::IEntity< TComponent >
 Base class for Component-Entity design pattern implementation driven by typesBasic Usage: Derive your entity class from IEntity<T> where T is the base class of your Entity class. More...
 
struct  ion::Type
 Lightweight wrapper for std::type_info that enables sorting (e.g. for use in a std::map) More...
 
struct  ion::RoundingError< T >
 Helper template to enable template-dependant epsilon values. More...
 
struct  ion::RoundingError< float >
 Template specialization of RoundingError for 32bit floating-point values. More...
 
struct  ion::RoundingError< double >
 Template specialization of RoundingError for 64bit floating-point values. More...
 
struct  ion::Constants< T >
 Template-friendly access to Constants32 or Constants64. More...
 
class  ion::Log
 Logging class. More...
 
class  ion::ITreeNode< Implementation >
 Interface for a Node in a generic tree structure.Note that a static_cast to TreeNode<Implementation> is sometimes needed for compilation in VS2012 where Implementation has 'uses' for Children or Parent since these fields will then have protected access in the subclass. More...
 
class  ion::Random
 Helper methods for generating random numbers. More...
 
class  ion::Singleton< Implementation >
 Base class for Singleton design pattern implementation. More...
 
class  ion::SingletonPointer< T >
 Wraps a pointer to a singleton object. More...
 
class  ion::String
 Helper methods for dealing with strings. More...
 
struct  ion::vec2< T >
 2D vector More...
 
struct  ion::vec3< T >
 3D vector More...
 
class  ion::vec4< T >
 4D vector More...
 

Macros

#define ION_ARRAYSIZE(x)   ((sizeof(x)/sizeof(0[x])) / ((size_t)(!(sizeof(x) % sizeof(0[x])))))
 Standard macro for computing size of a C-style arrayMore discussion here: https://stackoverflow.com/a/4415646/1390945. More...
 

Typedefs

template<typename T >
using ion::UniquePointer = std::unique_ptr< T >
 
template<typename T >
using ion::SharedPointer = std::shared_ptr< T >
 
template<typename T >
using ion::WeakPointer = std::weak_ptr< T >
 

Enumerations

enum  ion::ELogChannel { ion::ELogChannel::Error = 0, ion::ELogChannel::Warn = 1, ion::ELogChannel::Info = 2 }
 Channels used by Log. More...
 

Functions

uint ion::Color::PackBits24 (color3i const &Color)
 Packs a color into 24 bits. More...
 
color3i ion::Color::UnpackBits24 (uint const Value)
 Unpacks a color from 24 bits. More...
 
color3i ion::Color::Hex (uint const Value)
 Unpacks a color from 24 bits. More...
 
color3f ion::Color::HSV (float const H, float const S, float const V)
 Compute RGB color from HSV. More...
 
vec3f ion::Color::ToHSV (color3f const &Color)
 Compute RGB color from HSV. More...
 
template<typename T , typename U >
bool ion::InstanceOf (U *Object)
 Check whether an object is an instance of a type. More...
 
template<typename T , typename U >
bool ion::InstanceOf (U &Object)
 Check whether an object is an instance of a type. More...
 
template<typename T , typename U >
T * ion::As (U *Object)
 Casts an object as a different type, performing a validity check. More...
 
template<typename T , typename U >
T const * ion::As (U const *Object)
 Casts a constant object as a different type, performing a validity check. More...
 
template<typename T , typename U >
T & ion::As (U &Object)
 Casts an object as a different type, performing a validity check. More...
 
template<typename T , typename U >
T const & ion::As (U const &Object)
 Casts a constant object as a different type, performing a validity check. More...
 
template<typename T , typename U >
U * ion::ConditionalMapAccess (map< T, U * > const &Map, T const Key)
 
template<typename T , typename U >
SharedPointer< U > ion::ConditionalMapAccess (map< T, SharedPointer< U >> const &Map, T const Key)
 
template<typename T , typename U >
U * ion::ConditionalMapAccess (unordered_map< T, U * > const &Map, T const Key)
 
template<typename T , typename U >
bool ion::CheckMapAccess (map< T, U > const &Map, T const Key)
 
template<typename T , typename U >
bool ion::TryMapAccess (map< T, U > const &Map, T const Key, U &Value)
 
template<typename T , typename U >
set< T > ion::KeySet (map< T, U > const &Map)
 
template<typename T >
void ion::AddAtEnd (vector< T > &A, vector< T > const &B)
 
template<typename T >
void ion::EraseRemove (vector< T > &A, T B)
 
template<typename T , typename U >
void ion::EraseRemove (vector< T > &A, U B)
 
template<typename T >
ion::Abs (T const value)
 
template<typename T >
ion::Sin (T const value)
 
template<typename T >
ion::ArcSin (T const value)
 
template<typename T >
ion::Cos (T const value)
 
template<typename T >
ion::ArcCos (T const value)
 
template<typename T >
ion::Tan (T const value)
 
template<typename T >
ion::ArcTan (T const value)
 
template<typename T >
ion::ArcTan (T const y, T const x)
 
template<typename T >
ion::Sqrt (T const value)
 
template<typename T >
ion::DegToRad (T const degrees)
 
template<typename T >
ion::RadToDeg (T const radians)
 
template<typename T >
bool ion::IsNaN (T const value)
 
template<typename T >
ion::Saturate (T const value)
 Clamps a value between 0 and 1. More...
 
void ion::WaitForUser ()
 Portable version of system("PAUSE") More...
 
int ion::DigitCount (int n)
 Count the number of digits (including a - for negative numbers) in a decimal integer. More...
 
int ion::MakeEven (int const i)
 
bool ion::ToggleBool (bool &Condition)
 
float ion::Saturate (float const v)
 
double ion::Saturate (double const v)
 
template<typename T >
ion::Clamp (T const v, T const min, T const max)
 
template<typename T >
ion::Sq (T const a)
 
template<typename T >
ion::Average (T const a, T const b)
 
template<typename T >
ion::Average (T const a, T const b, T const c)
 
template<typename T >
ion::Average (T const a, T const b, T const c, T const d)
 
template<typename T >
ion::Sign (T const val)
 

Variables

float const ion::RoundingError32 = 0.00001f
 Global constant for 32bit floating-point epsilon. More...
 
double const ion::RoundingError64 = 0.00000001
 Global constant for 64bit floating-point epsilon. More...
 

Macro Definition Documentation

#define ION_ARRAYSIZE (   x)    ((sizeof(x)/sizeof(0[x])) / ((size_t)(!(sizeof(x) % sizeof(0[x])))))

Standard macro for computing size of a C-style arrayMore discussion here: https://stackoverflow.com/a/4415646/1390945.

Typedef Documentation

template<typename T >
using ion::SharedPointer = typedef std::shared_ptr<T>
template<typename T >
using ion::UniquePointer = typedef std::unique_ptr<T>
template<typename T >
using ion::WeakPointer = typedef std::weak_ptr<T>

Enumeration Type Documentation

enum ion::ELogChannel
strong

Channels used by Log.

Enumerator
Error 
Warn 
Info 

Function Documentation

template<typename T >
T ion::Abs ( T const  value)
template<typename T >
void ion::AddAtEnd ( vector< T > &  A,
vector< T > const &  B 
)
template<typename T >
T ion::ArcCos ( T const  value)
template<typename T >
T ion::ArcSin ( T const  value)
template<typename T >
T ion::ArcTan ( T const  value)
template<typename T >
T ion::ArcTan ( T const  y,
T const  x 
)
template<typename T , typename U >
T* ion::As ( U *  Object)

Casts an object as a different type, performing a validity check.

Parameters
ObjectPointer to object to cast
Template Parameters
TType to cast to
UType to cast from, type of Object
template<typename T , typename U >
T const* ion::As ( U const *  Object)

Casts a constant object as a different type, performing a validity check.

Parameters
ObjectPointer to object to cast
Template Parameters
TType to cast to
UType to cast from, type of Object
template<typename T , typename U >
T& ion::As ( U &  Object)

Casts an object as a different type, performing a validity check.

Parameters
ObjectReference to object to cast
Template Parameters
TType to cast to
UType to cast from, type of Object
template<typename T , typename U >
T const& ion::As ( U const &  Object)

Casts a constant object as a different type, performing a validity check.

Parameters
ObjectReference to object to cast
Template Parameters
TType to cast to
UType to cast from, type of Objec
template<typename T >
T ion::Average ( T const  a,
T const  b 
)
template<typename T >
T ion::Average ( T const  a,
T const  b,
T const  c 
)
template<typename T >
T ion::Average ( T const  a,
T const  b,
T const  c,
T const  d 
)
template<typename T , typename U >
bool ion::CheckMapAccess ( map< T, U > const &  Map,
T const  Key 
)
template<typename T >
T ion::Clamp ( T const  v,
T const  min,
T const  max 
)
template<typename T , typename U >
U* ion::ConditionalMapAccess ( map< T, U * > const &  Map,
T const  Key 
)
template<typename T , typename U >
SharedPointer<U> ion::ConditionalMapAccess ( map< T, SharedPointer< U >> const &  Map,
T const  Key 
)
template<typename T , typename U >
U* ion::ConditionalMapAccess ( unordered_map< T, U * > const &  Map,
T const  Key 
)
template<typename T >
T ion::Cos ( T const  value)
template<typename T >
T ion::DegToRad ( T const  degrees)
int ion::DigitCount ( int  n)

Count the number of digits (including a - for negative numbers) in a decimal integer.

template<typename T >
void ion::EraseRemove ( vector< T > &  A,
B 
)
template<typename T , typename U >
void ion::EraseRemove ( vector< T > &  A,
B 
)
color3i ion::Color::Hex ( uint const  Value)

Unpacks a color from 24 bits.

color3f ion::Color::HSV ( float const  H,
float const  S,
float const  V 
)

Compute RGB color from HSV.

template<typename T , typename U >
bool ion::InstanceOf ( U *  Object)

Check whether an object is an instance of a type.

Parameters
ObjectObject to check the type of
Template Parameters
TType to check Object against
UActual type of Object (best left inferred)

Implemented by checking the return value of dynamic_cast. Relies on RTTI.

template<typename T , typename U >
bool ion::InstanceOf ( U &  Object)

Check whether an object is an instance of a type.

Parameters
ObjectObject to check the type of
Template Parameters
TType to check Object against
UActual type of Object (best left inferred)

Implemented by checking the return value of dynamic_cast. Relies on RTTI.

template<typename T >
bool ion::IsNaN ( T const  value)
template<typename T , typename U >
set<T> ion::KeySet ( map< T, U > const &  Map)
int ion::MakeEven ( int const  i)
uint ion::Color::PackBits24 ( color3i const &  Color)

Packs a color into 24 bits.

template<typename T >
T ion::RadToDeg ( T const  radians)
float ion::Saturate ( float const  v)
double ion::Saturate ( double const  v)
template<typename T >
T ion::Saturate ( T const  value)

Clamps a value between 0 and 1.

Returns
value clamped between 0 and 1
template<typename T >
T ion::Sign ( T const  val)
template<typename T >
T ion::Sin ( T const  value)
template<typename T >
T ion::Sq ( T const  a)
template<typename T >
T ion::Sqrt ( T const  value)
template<typename T >
T ion::Tan ( T const  value)
bool ion::ToggleBool ( bool &  Condition)
vec3f ion::Color::ToHSV ( color3f const &  Color)

Compute RGB color from HSV.

template<typename T , typename U >
bool ion::TryMapAccess ( map< T, U > const &  Map,
T const  Key,
U &  Value 
)
color3i ion::Color::UnpackBits24 ( uint const  Value)

Unpacks a color from 24 bits.

void ion::WaitForUser ( )

Portable version of system("PAUSE")

Variable Documentation

float const ion::RoundingError32 = 0.00001f

Global constant for 32bit floating-point epsilon.

double const ion::RoundingError64 = 0.00000001

Global constant for 64bit floating-point epsilon.