Description

Namespaces

   
namespace Util::BidirectionalMapPolicies
namespace Util::BitmapUtils
namespace Util::EmbeddedFont
namespace Util::FallbackPolicies
namespace Util::GenericConversion
Conversion to and from Generic .
namespace Util::LibRegistry
namespace Util::MicroXML
namespace Util::Network
namespace Util::Numeric
namespace Util::PixelFormat
namespace Util::Profiling
namespace Util::Serialization
namespace Util::StringUtils
namespace Util::UI
namespace Util::Utils

Classes

   
class Util::_NumberAttribute
class Util::_StringAttribute
class Util::AbstractFSProvider
class Util::ArchiveProvider
class Util::AttributeAccessor
class Util::AttributeFormat
class Util::AttributeProvider
class Util::BidirectionalMap
class Util::BidirectionalUnorderedMap
class Util::Bitmap
class Util::BoolAttribute
class Util::Color4f
class Util::Color4ub
struct Util::ColorLibrary
class Util::CountedObjectWrapper
class Util::DBFSProvider
class Util::DebugOutput
class Util::Factory
Generic factory for objects.
class Util::FileLocator
class Util::FileName
struct Util::FileUtils
struct Util::FontInfo
class Util::FontRenderer
Font rendering.
class Util::FSProvider
struct Util::function_traits
struct Util::function_traits< ReturnType(ClassType::*)(Args…) const >
class Util::Generic
Container for a value with generic type.
class Util::GenericAttribute
class Util::GenericAttributeList
class Util::GenericAttributeMap
class Util::GenericAttributeSerialization
Serialization for GenericAttribute .
class Util::GenericNumberAttribute
class Util::GenericStringAttribute
struct Util::GlyphInfo
class Util::JSON_Parser
class Util::LambdaFactory
Generic factory for objects allowing lambdas with variable number of arguments as creator functions.
class Util::NetProvider
class Util::NoiseGenerator
class Util::ObjectCache
Generic object cache for objects allowing lambdas with variable number of arguments as cache functions.
class Util::ObjectCreator
Generic creator for objects.
struct Util::ObjectDeleter
class Util::ObjectPool
Generic object pool for objects.
class Util::OptionalRegistryHandleHolder
Safe storage for an optional RegistryHandle .
class Util::PixelAccessor
class Util::PointerHolderCreator
Creator for objects that holds a single instance.
class Util::PolymorphicWrapperCreator
Generic creator for wrapper objects.
class Util::ProgressIndicator
class Util::Reference
class Util::ReferenceAttribute
class Util::ReferenceCounter
Base class for reference-counted classes.
class Util::Registry
Registry for indistinguishable elements.
class Util::RegistryHandle
Handle used by Registry .
class Util::RegistryHandleHolder
Safe storage for a RegistryHandle .
class Util::Resource
class Util::ResourceAccessor
class Util::ResourceAllocator
class Util::ResourceFormat
class Util::SerialProvider
class Util::StringIdentifier
class Util::StructuredAccessor
class Util::TemporaryDirectory
Creation and deletion of temporary directories.
class Util::Timer
High resolution timer.
class Util::TriState
Class that can hold one of three values: true, fals, undefined.
class Util::UpdatableHeap
class Util::WeakPointer
class Util::WrapperAttribute
class Util::WrapperFactory
Generic factory for wrapper objects.
class Util::ZIPProvider

Hashing

   
   
constexpr uint32_t val_32_const
   
constexpr uint32_t prime_32_const
   
constexpr uint64_t val_64_const
   
constexpr uint64_t prime_64_const
   
uint32_t calcHash(const uint8_t * ptr, size_t size)
   
std::string md5(const std::string & str)
template< class T >  
void hash_combine(std::size_t & seed, const T & v)
   
void hash_param(size_t & seed)
template< typename T >  
void hash_param(size_t & seed, const T & value)
template< typename T , typename… Args >  
void hash_param(size_t & seed, const T & first_arg, const Args &… args)
template< typename T >  
size_t hash(const T & arg)
   
constexpr uint32_t hash32(const char *const str, const uint32_t value)
   
constexpr uint64_t hash64(const char *const str, const uint64_t value)
FNV1a c++11 constexpr compile time hash functions, 64 bit.

Enumerations

   
   
enum output_priority_t {OUTPUT_DEBUG, OUTPUT_WARNING, OUTPUT_ERROR}
   
enum TypeConstant {UINT8, UINT16, UINT32, UINT64, INT8, INT16, INT32, INT64, FLOAT, DOUBLE, HALF, BOOL}
This constants should not change and may be used for serialization.

Typedefs

   
   
typedef _StringAttribute < std::string > StringAttribute
   
typedef Util::Reference < Resource > ResourceRef

Variables

   
   
DebugOutput info

Functions

   
   
std::string encodeBase64(const std::vector< uint8_t > & source)
   
std::vector< uint8_t > decodeBase64(const std::string & source)
template< typename Function >  
function_traits < Function >::pointer to_function_pointer(Function & lambda)
template< typename Function >  
function_traits < Function >::function to_function(Function & lambda)
   
const StringIdentifier loadLibrary(const std::string & filename)
   
void * loadFunction(const StringIdentifier & libraryId, const std::string & name)
   
void unloadLibrary(const StringIdentifier & libraryId)
   
void output( output_priority_t priority, const std::string & message)
   
std::string composeDebugMessage(const std::string & message, const char * file, int line)
template< typename extension_t , typename object_t , typename… args >  
extension_t * addObjectExtension(object_t * obj, args &&… params)
template< typename extension_t , typename object_t , typename… args >  
extension_t * addObjectExtension(const StringIdentifier & extName, object_t * obj, args &&… params)
template< typename extension_t >  
extension_t * getObjectExtension(const Util::AttributeProvider * obj)
template< typename extension_t >  
extension_t * getObjectExtension(const StringIdentifier & extName, const Util::AttributeProvider * obj)
template< typename extension_t >  
extension_t * requireObjectExtension(const Util::AttributeProvider * obj)
template< typename extension_t >  
extension_t * requireObjectExtension(const StringIdentifier & extName, const Util::AttributeProvider * obj)
template< typename extension_t >  
bool hasObjectExtension(const Util::AttributeProvider * obj)
template< typename extension_t >  
bool hasObjectExtension(const StringIdentifier & extName, const Util::AttributeProvider * obj)
Returns true iff theobjecthas a extension of type extension_t namedextName.
   
size_t getNumBytes( TypeConstant t)
   
std::string getTypeString( TypeConstant t)
   
bool init()
   
void enableInfo()
   
void disableInfo()
template< typename T >  
T align(T offset, T alignment)
template< typename T >  
T clamp(T value, T min, T max)
template< typename T >  
double normalizeUnsigned(T value)
template< >  
double normalizeUnsigned(float value)
template< >  
double normalizeUnsigned(double value)
template< typename T >  
T unnormalizeUnsigned(double value)
template< >  
float unnormalizeUnsigned(double value)
template< >  
double unnormalizeUnsigned(double value)
template< typename T >  
double normalizeSigned(T value)
template< >  
double normalizeSigned(float value)
template< >  
double normalizeSigned(double value)
template< typename T >  
T unnormalizeSigned(double value)
template< >  
float unnormalizeSigned(double value)
template< >  
double unnormalizeSigned(double value)

Documentation

variable
Util::val_32_const

public
 
 
constexpr uint32_t val_32_const

Defined in Util/Hashing.h:57


variable
Util::prime_32_const

public
 
 
constexpr uint32_t prime_32_const

Defined in Util/Hashing.h:58


variable
Util::val_64_const

public
 
 
constexpr uint64_t val_64_const

Defined in Util/Hashing.h:59


variable
Util::prime_64_const

public
 
 
constexpr uint64_t prime_64_const

Defined in Util/Hashing.h:60


function
Util::calcHash

public
     
     
uint32_t calcHash( const uint8_t * ptr,
  size_t size
)    

Defined in Util/Hashing.h:28


function
Util::md5

public
     
     
std::string md5( const std::string & str )

Defined in Util/Hashing.h:30


function
Util::hash_combine

public inline
     
template< class T >    
void hash_combine( std::size_t & seed,
  const T & v
)    

Defined in Util/Hashing.h:33


function
Util::hash_param

public inline
     
     
void hash_param( size_t & seed )

Defined in Util/Hashing.h:38


function
Util::hash_param

public inline
     
template< typename T >    
void hash_param( size_t & seed,
  const T & value
)    

Defined in Util/Hashing.h:41


function
Util::hash_param

public inline
     
template< typename T , typename… Args >    
void hash_param( size_t & seed,
  const T & first_arg,
  const Args &… args
)    

Defined in Util/Hashing.h:46


function
Util::hash

public inline
     
template< typename T >    
size_t hash( const T & arg )

Defined in Util/Hashing.h:52


function
Util::hash32

public inline
     
     
constexpr uint32_t hash32( const char *const str,
  const uint32_t value
)    

FNV1a c++11 constexpr compile time hash functions, 32 bit str should be a null terminated string literal, value should be left out e.g hash32(“example”) code license: public domain or equivalent post:https://notes.underscorediscovery.com/constexpr-fnv1a/

Defined in Util/Hashing.h:68


function
Util::hash64

public inline
     
     
constexpr uint64_t hash64( const char *const str,
  const uint64_t value
)    

FNV1a c++11 constexpr compile time hash functions, 64 bit.

See also: { hash32() }

Defined in Util/Hashing.h:73


enum
Util::output_priority_t

public
 
 
enum output_priority_t
Enumerator   Description
Enumerator   Description
OUTPUT_DEBUG    
OUTPUT_WARNING    
OUTPUT_ERROR    

Defined in Util/Macros.h:22


enum
Util::TypeConstant

public
 
 
enum TypeConstant
Enumerator   Description
Enumerator   Description
UINT8 = 0  
UINT16 = 1  
UINT32 = 2  
UINT64 = 3  
INT8 = 4  
INT16 = 5  
INT32 = 6  
INT64 = 7  
FLOAT = 8  
DOUBLE = 9  
HALF = 10  
BOOL = 11  

This constants should not change and may be used for serialization.

Defined in Util/TypeConstant.h:22


typedef
Util::StringAttribute

public
 
 
typedef _StringAttribute < std::string > StringAttribute

Defined in Util/GenericAttribute.h:32


typedef
Util::ResourceRef

public
 
 
typedef Util::Reference < Resource > ResourceRef

Defined in Util/Resources/ResourceAccessor.h:24


variable
Util::info

public
 
 
DebugOutput info

Defined in Util/Utils.h:156


function
Util::encodeBase64

public
     
     
std::string encodeBase64( const std::vector< uint8_t > & source )

Defined in Util/Encoding.h:23


function
Util::decodeBase64

public
     
     
std::vector< uint8_t > decodeBase64( const std::string & source )

Defined in Util/Encoding.h:24


function
Util::to_function_pointer

public
     
template< typename Function >    
function_traits < Function >::pointer to_function_pointer( Function & lambda )

Defined in Util/Factory/LambdaFactory.h:40


function
Util::to_function

public
     
template< typename Function >    
function_traits < Function >::function to_function( Function & lambda )

Defined in Util/Factory/LambdaFactory.h:46


function
Util::loadLibrary

public
     
     
const StringIdentifier loadLibrary( const std::string & filename )

Function used to dynamically load a library at runtime.

Note: This is highly experimental and not intended for use in production code. Use with caution.

Parameters

filename
File path to the dynamic library.

Returns

StringIdentifier of the filename on success (used as library handle), or empty StringIdentifier on failure.

Defined in Util/LoadLibrary.h:29


function
Util::loadFunction

public
     
     
void * loadFunction( const StringIdentifier & libraryId,
  const std::string & name
)    

Loads a function of a dynamically loaded library at runtime.

Note: This is highly experimental and not intended for use in production code. Use with caution.

Parameters

libraryId
Library handle received from loadLibrary.
name
name of the function.

Returns

Function handle or nullptr.

Defined in Util/LoadLibrary.h:40


function
Util::unloadLibrary

public
     
     
void unloadLibrary( const StringIdentifier & libraryId )

Function used to unload a dynamically loaded library.

Note: This is highly experimental and not intended for use in production code. Use with caution. Actually, don’t use it at all, because it can cause unforseeable side effects.

Parameters

libraryId
Library handle received from loadLibrary.

Defined in Util/LoadLibrary.h:50


function
Util::output

public
     
     
void output( output_priority_t priority,
  const std::string & message
)    

Defined in Util/Macros.h:27


function
Util::composeDebugMessage

public
     
     
std::string composeDebugMessage( const std::string & message,
  const char * file,
  int line
)    

Defined in Util/Macros.h:28


function
Util::addObjectExtension

public
     
template< typename extension_t , typename object_t , typename… args >    
extension_t * addObjectExtension( object_t * obj,
  args &&… params
)    

Create and add an extension of type extension_t to the givenobject.

  • Additional parameters are passed to the extension’s constructor.

  • The extension’s name is inquired by calling extension_t::getObjectExtensionName() or extension_t::getClassId()

  • The created extension is returned.

Defined in Util/ObjectExtension.h:167


function
Util::addObjectExtension

public
     
template< typename extension_t , typename object_t , typename… args >    
extension_t * addObjectExtension( const StringIdentifier & extName,
  object_t * obj,
  args &&… params
)    

Create and add an extension of type extension_t to the givenobjectnamedextName.

See also: addObjectExtension (obj, params…)

Defined in Util/ObjectExtension.h:175


function
Util::getObjectExtension

public
     
template< typename extension_t >    
extension_t * getObjectExtension( const Util::AttributeProvider * obj )

If the givenobjecthas a extension of type extension_t, it is returned; nullptr otherwise.

  • The extension’s name is inquired by calling extension_t::getObjectExtensionName() or extension_t::getClassId()

Defined in Util/ObjectExtension.h:182


function
Util::getObjectExtension

public
     
template< typename extension_t >    
extension_t * getObjectExtension( const StringIdentifier & extName,
  const Util::AttributeProvider * obj
)    

If the givenobjecthas a extension of type extension_t namedextName, it is returned; nullptr otherwise.

See also: getObjectExtension(obj)

Defined in Util/ObjectExtension.h:189


function
Util::requireObjectExtension

public
     
template< typename extension_t >    
extension_t * requireObjectExtension( const Util::AttributeProvider * obj )

If the givenobjecthas a extension of type extension_t, it is returned; otherwise, an exception is thrown.

  • The extension’s name is inquired by calling extension_t::getObjectExtensionName() or extension_t::getClassId().

Defined in Util/ObjectExtension.h:196


function
Util::requireObjectExtension

public
     
template< typename extension_t >    
extension_t * requireObjectExtension( const StringIdentifier & extName,
  const Util::AttributeProvider * obj
)    

If the givenobjecthas a extension of type extension_t namedextName, it is returned; otherwise, an exception is thrown.

  • The extension’s name is inquired by calling extension_t::getObjectExtensionName() or extension_t::getClassId().

Defined in Util/ObjectExtension.h:203


function
Util::hasObjectExtension

public
     
template< typename extension_t >    
bool hasObjectExtension( const Util::AttributeProvider * obj )

Returns true iff theobjecthas a extension of type extension_t.

  • The extension’s name is inquired by calling extension_t::getObjectExtensionName() or extension_t::getClassId().

Defined in Util/ObjectExtension.h:212


function
Util::hasObjectExtension

public
     
template< typename extension_t >    
bool hasObjectExtension( const StringIdentifier & extName,
  const Util::AttributeProvider * obj
)    

Returns true iff theobjecthas a extension of type extension_t namedextName.

Defined in Util/ObjectExtension.h:217


function
Util::getNumBytes

public
     
     
size_t getNumBytes( TypeConstant t )

Defined in Util/TypeConstant.h:37


function
Util::getTypeString

public
     
     
std::string getTypeString( TypeConstant t )

Defined in Util/TypeConstant.h:39


function
Util::init

public
   
   
bool init( )

Initialize the Util library. This function has to be called at least once before using the library.

Parameters

:

Defined in Util/Util.h:25


function
Util::enableInfo

public
   
   
void enableInfo( )

Defined in Util/Utils.h:158


function
Util::disableInfo

public
   
   
void disableInfo( )

Defined in Util/Utils.h:159


function
Util::align

public inline
     
template< typename T >    
T align( T offset,
  T alignment
)    

Defined in Util/Utils.h:164


function
Util::clamp

public inline
     
template< typename T >    
T clamp( T value,
  T min,
  T max
)    

Defined in Util/Utils.h:171


function
Util::normalizeUnsigned

public inline
     
template< typename T >    
double normalizeUnsigned( T value )

Defined in Util/Utils.h:176


function
Util::normalizeUnsigned

public inline
     
template< >    
double normalizeUnsigned( float value )

Defined in Util/Utils.h:178


function
Util::normalizeUnsigned

public inline
     
template< >    
double normalizeUnsigned( double value )

Defined in Util/Utils.h:180


function
Util::unnormalizeUnsigned

public inline
     
template< typename T >    
T unnormalizeUnsigned( double value )

Defined in Util/Utils.h:185


function
Util::unnormalizeUnsigned

public inline
     
template< >    
float unnormalizeUnsigned( double value )

Defined in Util/Utils.h:187


function
Util::unnormalizeUnsigned

public inline
     
template< >    
double unnormalizeUnsigned( double value )

Defined in Util/Utils.h:189


function
Util::normalizeSigned

public inline
     
template< typename T >    
double normalizeSigned( T value )

Defined in Util/Utils.h:194


function
Util::normalizeSigned

public inline
     
template< >    
double normalizeSigned( float value )

Defined in Util/Utils.h:196


function
Util::normalizeSigned

public inline
     
template< >    
double normalizeSigned( double value )

Defined in Util/Utils.h:198


function
Util::unnormalizeSigned

public inline
     
template< typename T >    
T unnormalizeSigned( double value )

Defined in Util/Utils.h:203


function
Util::unnormalizeSigned

public inline
     
template< >    
float unnormalizeSigned( double value )

Defined in Util/Utils.h:205


function
Util::unnormalizeSigned

public inline
     
template< >    
double unnormalizeSigned( double value )

Defined in Util/Utils.h:207