Files | 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  ionComponent.h
 Basic component-entity system driven by types.
 
file  ionLogger.h
 Logging class.
 
file  ionRand.h
 Random number generators and helpers.
 
file  ionSmartPointer.h
 Brings some standard library pointer classes into ion namespace.
 
file  ionStandardLibrary.h
 Brings a lot of elements from std namespace into the global namespace.
 
file  ionThread.h
 Brings some standard library thread classes into ion namespace.
 
file  ionTypes.h
 Defines typedefs for integer and floating point types.
 
file  ionUtils.h
 General helper functions.
 

Classes

class  ion::Bitwise
 Tools for bitwise operations. More...
 
class  Singleton< Implementation >
 Base class for Singleton design pattern implementation. More...
 
class  SingletonPointer< T >
 Wraps a pointer to a singleton object. More...
 
struct  Type
 Lightweight wrapper for std::type_info that enables sorting (e.g. for use in a std::map) More...
 
struct  RoundingError< T >
 Helper template to enable template-dependant epsilon values. More...
 
struct  RoundingError< f32 >
 Template specialization of RoundingError for 32bit floating-point values. More...
 
struct  RoundingError< f64 >
 Template specialization of RoundingError for 64bit floating-point values. More...
 
class  IEntity< TComponent >
 Base class for Component-Entity design pattern implementation. More...
 
class  Log
 Logging class. More...
 
class  Random
 Helper methods for generating random numbers. More...
 
class  IRandomGenerator
 Interface for random number generation. More...
 
class  CLinearCongruentialGenerator
 Basic LCG implementation. More...
 
class  File
 Helper methods for dealing with files. More...
 
class  String
 Helper methods for dealing with strings. More...
 
class  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...
 

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 UniquePointer = std::unique_ptr< T >
 
template<typename T >
using SharedPointer = std::shared_ptr< T >
 
template<typename T >
using WeakPointer = std::weak_ptr< T >
 
template<typename T >
using NumericLimits = std::numeric_limits< T >
 
typedef std::lock_guard< std::mutex > scopedLock
 
typedef std::lock_guard< std::mutex > LockGuard
 

Enumerations

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

Functions

template<typename T , typename U >
bool InstanceOf (U *Object)
 Check whether an object is an instance of a type. More...
 
template<typename T , typename U >
bool InstanceOf (U &Object)
 Check whether an object is an instance of a type. More...
 
template<typename T , typename U >
T * As (U *Object)
 Casts an object as a different type, performing a validity check. More...
 
template<typename T , typename U >
T const * As (U const *Object)
 Casts a constant object as a different type, performing a validity check. More...
 
template<typename T , typename U >
T & As (U &Object)
 Casts an object as a different type, performing a validity check. More...
 
template<typename T , typename U >
T const & As (U const &Object)
 Casts a constant object as a different type, performing a validity check. More...
 
template<typename T , typename U >
U * ConditionalMapAccess (map< T, U * > const &Map, T const Key)
 
template<typename T , typename U >
SharedPointer< U > ConditionalMapAccess (map< T, SharedPointer< U >> const &Map, T const Key)
 
template<typename T , typename U >
U * ConditionalMapAccess (unordered_map< T, U * > const &Map, T const Key)
 
template<typename T , typename U >
bool CheckMapAccess (map< T, U > const &Map, T const Key)
 
template<typename T , typename U >
bool TryMapAccess (map< T, U > const &Map, T const Key, U &Value)
 
template<typename T , typename U >
set< T > KeySet (map< T, U > const &Map)
 
template<typename T >
void AddAtEnd (vector< T > &A, vector< T > const &B)
 
template<typename T >
void EraseRemove (vector< T > &A, T B)
 
template<typename T , typename U >
void EraseRemove (vector< T > &A, U B)
 
template<typename T >
Clamp (T const &v, T const &min, T const &max)
 
template<typename T >
Sq (T const &a)
 
template<typename T >
Average (T const &a, T const &b)
 
template<typename T >
Average (T const &a, T const &b, T const &c)
 
template<typename T >
Average (T const &a, T const &b, T const &c, T const &d)
 
template<typename T >
MakeEven (T const i)
 
template<typename T >
s32 Sign (T const &val)
 
template<typename T >
ToggleBool (T &Condition)
 

Variables

f32 const RoundingError32 = 0.00001f
 Global constant for 32bit floating-point epsilon. More...
 
f64 const 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

typedef std::lock_guard<std::mutex> LockGuard
template<typename T >
using NumericLimits = std::numeric_limits<T>
typedef std::lock_guard<std::mutex> scopedLock
template<typename T >
using SharedPointer = std::shared_ptr<T>
template<typename T >
using UniquePointer = std::unique_ptr<T>
template<typename T >
using WeakPointer = std::weak_ptr<T>

Enumeration Type Documentation

enum ELogChannel
strong

Channels used by Log.

Enumerator
Error 
Warn 
Info 

Function Documentation

template<typename T >
void AddAtEnd ( vector< T > &  A,
vector< T > const &  B 
)
template<typename T , typename U >
T* 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* 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& 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& 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 Average ( T const &  a,
T const &  b 
)
template<typename T >
T Average ( T const &  a,
T const &  b,
T const &  c 
)
template<typename T >
T Average ( T const &  a,
T const &  b,
T const &  c,
T const &  d 
)
template<typename T , typename U >
bool CheckMapAccess ( map< T, U > const &  Map,
T const  Key 
)
template<typename T >
T Clamp ( T const &  v,
T const &  min,
T const &  max 
)
template<typename T , typename U >
U* ConditionalMapAccess ( map< T, U * > const &  Map,
T const  Key 
)
template<typename T , typename U >
SharedPointer<U> ConditionalMapAccess ( map< T, SharedPointer< U >> const &  Map,
T const  Key 
)
template<typename T , typename U >
U* ConditionalMapAccess ( unordered_map< T, U * > const &  Map,
T const  Key 
)
template<typename T >
void EraseRemove ( vector< T > &  A,
B 
)
template<typename T , typename U >
void EraseRemove ( vector< T > &  A,
B 
)
template<typename T , typename U >
bool 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 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 >
set<T> KeySet ( map< T, U > const &  Map)
template<typename T >
T MakeEven ( T const  i)
template<typename T >
s32 Sign ( T const &  val)
template<typename T >
T Sq ( T const &  a)
template<typename T >
T ToggleBool ( T &  Condition)
template<typename T , typename U >
bool TryMapAccess ( map< T, U > const &  Map,
T const  Key,
U &  Value 
)

Variable Documentation

f32 const RoundingError32 = 0.00001f

Global constant for 32bit floating-point epsilon.

f64 const RoundingError64 = 0.00000001

Global constant for 64bit floating-point epsilon.