This documents an old version of bs::framework. Click here to see the latest release.
General

Description

General utility functionality that doesn't fit in any other category.

Classes

class  Any
 Class capable of storing any general type, and safely extracting the proper type from the internal data. More...
 
class  Bitfield
 Dynamically sized field that contains a sequential list of bits. More...
 
union  Float754
 Floating point number broken down into components for easier access. More...
 
union  Float10
 10-bit floating point number broken down into components for easier access. More...
 
union  Float11
 11-bit floating point number broken down into components for easier access. More...
 
class  Bitwise
 Class for manipulating bit patterns. More...
 
class  Compression
 Performs generic compression and decompression on raw data. More...
 
struct  DataBlob
 Serializable blob of raw memory. More...
 
class  DynLib
 Class that holds data about a dynamic library. More...
 
class  DynLibManager
 This manager keeps track of all the open dynamic-loading libraries, it manages opening them opens them and can be used to lookup already already-open libraries. More...
 
class  HEvent
 Event handle. More...
 
class  Event< Signature >
 Events allows you to register method callbacks that get notified when the event is triggered. More...
 
class  Event< RetType(Args...) >
 Events allows you to register method callbacks that get notified when the event is triggered. More...
 
class  Flags< Enum, Storage >
 Wrapper around an enum that allows simple use of bitwise logic operations. More...
 
class  LookupTable
 Contains a set of samples resulting from sampling some function at equal intervals. More...
 
class  MessageHandler
 Allows you to transparently pass messages between different systems. More...
 
class  MessageId
 Identifier for message used with the global messaging system. More...
 
class  HMessage
 Handle to a subscription for a specific message in the global messaging system. More...
 
class  Module< T >
 Represents one engine module. More...
 
class  INonCopyable
 Interface that prevents copies be made of any type that implements it. More...
 
class  OctreeElementId
 Identifier that may be used for finding an element in the octree. More...
 
class  Octree< ElemType, Options >
 Spatial partitioning tree for 3D space. More...
 
struct  GPUInfo
 Contains information about available GPUs on the system. More...
 
struct  SystemInfo
 Contains information about the system hardware and operating system. More...
 
class  PlatformUtility
 Provides access to various operating system specific utility functions. More...
 
class  ServiceLocator< T >
 A locator system that allows you to quickly find a service of a specific type. More...
 
class  Time
 Manages all time related functionality. More...
 
class  Timer
 Timer class used for querying high precision timers. More...
 
struct  Tetrahedron
 Contains information about a single tetrahedron. More...
 
struct  TetrahedronFace
 Contains information about a single face of a tetrahedron. More...
 
struct  TetrahedronVolume
 Contains information about a volume made out of tetrahedrons. More...
 
class  Triangulation
 Contains helper methods that triangulate point data. More...
 

Macros

#define DYNLIB_HANDLE   hInstance
 
#define DYNLIB_LOAD(a)   LoadLibraryEx( a, NULL, LOAD_WITH_ALTERED_SEARCH_PATH )
 
#define DYNLIB_GETSYM(a, b)   GetProcAddress( a, b )
 
#define DYNLIB_UNLOAD(a)   !FreeLibrary( a )
 
#define BS_FLAGS_OPERATORS(Enum)   BS_FLAGS_OPERATORS_EXT(Enum, UINT32)
 Defines global operators for a Flags<Enum, Storage> implementation. More...
 
#define BS_FLAGS_OPERATORS_EXT(Enum, Storage)
 Defines global operators for a Flags<Enum, Storage> implementation. More...
 

Typedefs

typedef const BitfieldArrayType
 
typedef BitReferenceConst ReferenceType
 
typedef BitfieldArrayType
 
typedef BitReference ReferenceType
 
typedef TBitfieldIteratorTypes< CONST >::ArrayType ArrayType
 
typedef TBitfieldIteratorTypes< CONST >::ReferenceType ReferenceType
 
using Iterator = TBitfieldIterator< false >
 
using ConstIterator = TBitfieldIterator< true >
 

Functions

template<typename ValueType >
ValueType * any_cast (Any *operand)
 Returns a pointer to the internal data of the specified type. More...
 
template<typename ValueType >
const ValueType * any_cast (const Any *operand)
 Returns a const pointer to the internal data of the specified type. More...
 
template<typename ValueType >
ValueType any_cast (const Any &operand)
 Returns a copy of the internal data of the specified type. More...
 
template<typename ValueType >
ValueType any_cast (Any &operand)
 Returns a copy of the internal data of the specified type. More...
 
template<typename ValueType >
const ValueType & any_cast_ref (const Any &operand)
 Returns a reference to the internal data of the specified type. More...
 
template<typename ValueType >
ValueType & any_cast_ref (Any &operand)
 Returns a reference to the internal data of the specified type. More...
 
template<typename ValueType >
ValueType * any_cast_unsafe (Any *operand)
 Casts a type without performing any kind of checks. More...
 
template<typename ValueType >
const ValueType * any_cast_unsafe (const Any *operand)
 Casts a type without performing any kind of checks. More...
 
 BitReferenceConst (const uint32_t &data, uint32_t bitMask)
 
 operator bool () const
 
 BitReference (uint32_t &data, uint32_t bitMask)
 
 operator bool () const
 
BitReferenceoperator= (bool value)
 
BitReferenceoperator= (const BitReference &rhs)
 
 TBitfieldIterator (ArrayType owner, uint32_t bitIndex, uint32_t dwordIndex, uint32_t mask)
 
TBitfieldIteratoroperator++ ()
 
 operator bool () const
 
bool operator! () const
 
bool operator!= (const TBitfieldIterator &rhs)
 
ReferenceType operator * () const
 
 Bitfield (bool value=false, uint32_t count=0)
 Initializes the bitfield with enough storage for count bits and sets them to the initial value of value.
 
 Bitfield (const Bitfield &other)
 
 Bitfield (Bitfield &&other)
 
Bitfieldoperator= (const Bitfield &rhs)
 
Bitfieldoperator= (Bitfield &&rhs)
 
BitReference operator[] (uint32_t idx)
 
BitReferenceConst operator[] (uint32_t idx) const
 
uint32_t add (bool value)
 Adds a new bit value to the end of the bitfield and returns the index of the added bit. More...
 
void remove (uint32_t index)
 Removes a bit at the specified index. More...
 
uint32_t find (bool value) const
 Attempts to find the first non-zero bit in the field. More...
 
uint32_t count (bool value) const
 Counts the number of values in the bit field. More...
 
void reset (bool value=false)
 Resets all the bits in the field to the specified value. More...
 
void clear (bool free=false)
 Removes all the bits from the field. More...
 
uint32_t size () const
 Returns the number of bits in the bitfield.
 
Iterator begin ()
 Returns a non-const iterator pointing to the first bit in the bitfield. More...
 
Iterator end ()
 Returns a non-const interator pointing past the last bit in the bitfield. More...
 
ConstIterator begin () const
 Returns a const iterator pointing to the first bit in the bitfield. More...
 
ConstIterator end () const
 Returns a const interator pointing past the last bit in the bitfield. More...
 
BS_UTILITY_EXPORT DynLibManagergDynLibManager ()
 Easy way of accessing DynLibManager. More...
 
void BS_UTILITY_EXPORT sendMessage (MessageId message)
 Sends a message using the global messaging system. More...
 
BS_UTILITY_EXPORT TimegTime ()
 Easier way to access the Time module. More...
 
template<class T >
void hash_combine (std::size_t &seed, const T &v)
 Generates a new hash for the provided type using the default standard hasher and combines it with a previous hash. More...
 
String BS_UTILITY_EXPORT md5 (const WString &source)
 Generates an MD5 hash string for the provided source string. More...
 
String BS_UTILITY_EXPORT md5 (const String &source)
 Generates an MD5 hash string for the provided source string. More...
 
template<class T >
void bs_zero_out (T &s)
 Sets contents of a struct to zero. More...
 
template<class T , size_t N>
void bs_zero_out (T(&arr)[N])
 Sets contents of a static array to zero. More...
 
template<class T >
void bs_zero_out (T *arr, size_t count)
 Sets contents of a block of memory to zero. More...
 
template<class T , size_t N>
void bs_copy (T(&dst)[N], T(&src)[N], size_t count)
 Copies the contents of one array to another. More...
 
template<class T >
void bs_copy (T *dst, T *src, size_t count)
 Copies the contents of one array to another. More...
 
template<class T , std::size_t N>
constexpr size_t bs_size (const T(&array)[N])
 Returns the size of the provided static array. More...
 
template<class T , class A = StdAlloc<T>>
bool bs_swap_and_erase (Vector< T, A > &container, const typename Vector< T, A >::iterator iter)
 Erases the provided element from the container, but first swaps the element so its located at the end of the container, making the erase operation cheaper at the cost of an extra move operation. More...
 

Variables

const uint32_t & mData
 
uint32_t mBitMask
 
uint32_t & mData
 
uint32_t mBitMask
 

Macro Definition Documentation

◆ BS_FLAGS_OPERATORS

#define BS_FLAGS_OPERATORS (   Enum)    BS_FLAGS_OPERATORS_EXT(Enum, UINT32)

Defines global operators for a Flags<Enum, Storage> implementation.

◆ BS_FLAGS_OPERATORS_EXT

#define BS_FLAGS_OPERATORS_EXT (   Enum,
  Storage 
)
Value:
inline Flags<Enum, Storage> operator|(Enum a, Enum b) { Flags<Enum, Storage> r(a); r |= b; return r; } \
inline Flags<Enum, Storage> operator&(Enum a, Enum b) { Flags<Enum, Storage> r(a); r &= b; return r; } \
inline Flags<Enum, Storage> operator~(Enum a) { return ~Flags<Enum, Storage>(a); }

Defines global operators for a Flags<Enum, Storage> implementation.

Function Documentation

◆ add()

uint32_t add ( bool  value)

Adds a new bit value to the end of the bitfield and returns the index of the added bit.

◆ any_cast() [1/4]

ValueType* bs::any_cast ( Any operand)

Returns a pointer to the internal data of the specified type.

Note
Will return null if cast fails.

◆ any_cast() [2/4]

const ValueType* bs::any_cast ( const Any operand)

Returns a const pointer to the internal data of the specified type.

Note
Will return null if cast fails.

◆ any_cast() [3/4]

ValueType bs::any_cast ( const Any operand)

Returns a copy of the internal data of the specified type.

Note
Throws an exception if cast fails.

◆ any_cast() [4/4]

ValueType bs::any_cast ( Any operand)

Returns a copy of the internal data of the specified type.

Note
Throws an exception if cast fails.

◆ any_cast_ref() [1/2]

const ValueType& bs::any_cast_ref ( const Any operand)

Returns a reference to the internal data of the specified type.

Note
Throws an exception if cast fails.

◆ any_cast_ref() [2/2]

ValueType& bs::any_cast_ref ( Any operand)

Returns a reference to the internal data of the specified type.

Note
Throws an exception if cast fails.

◆ any_cast_unsafe() [1/2]

ValueType* bs::any_cast_unsafe ( Any operand)

Casts a type without performing any kind of checks.

◆ any_cast_unsafe() [2/2]

const ValueType* bs::any_cast_unsafe ( const Any operand)

Casts a type without performing any kind of checks.

◆ begin() [1/2]

Iterator begin ( )

Returns a non-const iterator pointing to the first bit in the bitfield.

◆ begin() [2/2]

ConstIterator begin ( ) const

Returns a const iterator pointing to the first bit in the bitfield.

◆ bs_copy() [1/2]

void bs::bs_copy ( T(&)  dst[N],
T(&)  src[N],
size_t  count 
)

Copies the contents of one array to another.

Automatically accounts for array element size.

◆ bs_copy() [2/2]

void bs::bs_copy ( T *  dst,
T *  src,
size_t  count 
)

Copies the contents of one array to another.

Automatically accounts for array element size.

◆ bs_size()

constexpr size_t bs::bs_size ( const T(&)  array[N])

Returns the size of the provided static array.

◆ bs_swap_and_erase()

bool bs::bs_swap_and_erase ( Vector< T, A > &  container,
const typename Vector< T, A >::iterator  iter 
)

Erases the provided element from the container, but first swaps the element so its located at the end of the container, making the erase operation cheaper at the cost of an extra move operation.

Doesn't preserve ordering within the element. Returns true if a swap occurred, or false if the element was already at the end of the container.

◆ bs_zero_out() [1/3]

void bs::bs_zero_out ( T &  s)

Sets contents of a struct to zero.

◆ bs_zero_out() [2/3]

void bs::bs_zero_out ( T(&)  arr[N])

Sets contents of a static array to zero.

◆ bs_zero_out() [3/3]

void bs::bs_zero_out ( T *  arr,
size_t  count 
)

Sets contents of a block of memory to zero.

◆ clear()

void clear ( bool  free = false)

Removes all the bits from the field.

If free is true then the underlying memory buffers will be freed as well.

◆ count()

uint32_t count ( bool  value) const

Counts the number of values in the bit field.

◆ end() [1/2]

Iterator end ( )

Returns a non-const interator pointing past the last bit in the bitfield.

◆ end() [2/2]

ConstIterator end ( ) const

Returns a const interator pointing past the last bit in the bitfield.

◆ find()

uint32_t find ( bool  value) const

Attempts to find the first non-zero bit in the field.

Returns -1 if all bits are zero or the field is empty.

◆ gDynLibManager()

BS_UTILITY_EXPORT DynLibManager& bs::gDynLibManager ( )

Easy way of accessing DynLibManager.

◆ gTime()

BS_UTILITY_EXPORT Time& bs::gTime ( )

Easier way to access the Time module.

◆ hash_combine()

void bs::hash_combine ( std::size_t &  seed,
const T &  v 
)

Generates a new hash for the provided type using the default standard hasher and combines it with a previous hash.

◆ md5() [1/2]

String BS_UTILITY_EXPORT bs::md5 ( const WString source)

Generates an MD5 hash string for the provided source string.

◆ md5() [2/2]

String BS_UTILITY_EXPORT bs::md5 ( const String source)

Generates an MD5 hash string for the provided source string.

◆ remove()

void remove ( uint32_t  index)

Removes a bit at the specified index.

◆ reset()

void reset ( bool  value = false)

Resets all the bits in the field to the specified value.

◆ sendMessage()

void BS_UTILITY_EXPORT bs::sendMessage ( MessageId  message)

Sends a message using the global messaging system.

Note
Sim thread only.