Rasterfarm-SDK
Loading...
Searching...
No Matches
utils.h File Reference
#include <cxxabi.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <vector>
#include <list>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <limits>
#include <algorithm>
#include <numeric>

Namespaces

namespace  Engine
 API for creating Applications and rasterization-engines.
 

Macros

#define stringify(string)   #string
 
#define copyToSequenceContainer(source, dest)
 
#define forEach(item, container)    for( auto &item : container )
 
#define ARRAY_LENGTH(array)    sizeof( array ) / sizeof( array[0] )
 
#define EGL_CHECK_ERROR()
 
#define GL_CHECK_ERROR()
 
#define INSTRUMENT(var)
 
#define WARNING(var)
 
#define ARRAY_COPY(dst, src)    memcpy( ( void * )&dst, &src, sizeof( src ) );
 
#define STREAM_PRINT_VAR_VAL(var)    #var << " :\n" << var
 
#define ENGINE_NAMESPACE_BEGIN   namespace Engine {
 
#define ENGINE_NAMESPACE_END   }
 

Functions

std::string Engine::demangle (const char *str)
 
void Engine::insertAfterEach (const char *token, const char *insert, std::string &str)
 
std::vector< std::string > Engine::tokenize (const std::string &source, const char *delimiter=" ")
 
template<typename FROM , typename RETURN >
RETURN Engine::convert (const FROM &from)
 
template<typename T >
bool Engine::powerOfTwo (T value)
 
template<typename T >
bool Engine::compare (const T &v1, const T &v2, T precision)
 
template<typename T >
T Engine::clamp (T value, T lower, T upper)
 
template<typename T >
int Engine::sign (T val)
 
template<typename T >
T Engine::degreesToRadians (T angle)
 
template<typename T >
T Engine::radiansToDegrees (T radians)
 
template<class C , typename I >
C::const_iterator Engine::findIterator (const C &container, const I &item)
 
template<class C , typename I >
C::iterator Engine::findIterator (C &container, const I &item)
 
template<class C , typename I >
bool Engine::contains (const C &container, const I &item)
 
template<class M , typename K >
bool Engine::mapContains (const M &map, const K &key)
 
template<typename T >
std::vector< uint > Engine::sortIndexes (const std::vector< T > &v)
 
template<typename T >
std::vector< TEngine::getCSV (std::string str)
 
template<class STL >
bool Engine::hasDuplicates (const STL &container)
 
template<class C , typename I >
uint Engine::getIndex (const C &container, const I &item)
 
bool Engine::doesFileExist (const char *file)
 
std::string Engine::addLineNumbers (const char *str)
 
std::string Engine::baseName (const char *str, bool removeSuffix)
 

Variables

const bool Engine::isLittleEndian = ( __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ )
 

Macro Definition Documentation

◆ ARRAY_COPY

#define ARRAY_COPY ( dst,
src )    memcpy( ( void * )&dst, &src, sizeof( src ) );

◆ ARRAY_LENGTH

#define ARRAY_LENGTH ( array)     sizeof( array ) / sizeof( array[0] )

◆ copyToSequenceContainer

#define copyToSequenceContainer ( source,
dest )
Value:
dest.resize( source.size() );\
std::copy( source.begin(), source.end(), dest.begin() );

◆ EGL_CHECK_ERROR

#define EGL_CHECK_ERROR ( )

◆ ENGINE_NAMESPACE_BEGIN

#define ENGINE_NAMESPACE_BEGIN   namespace Engine {

◆ ENGINE_NAMESPACE_END

#define ENGINE_NAMESPACE_END   }

◆ forEach

#define forEach ( item,
container )    for( auto &item : container )

◆ GL_CHECK_ERROR

#define GL_CHECK_ERROR ( )

◆ INSTRUMENT

#define INSTRUMENT ( var)

◆ STREAM_PRINT_VAR_VAL

#define STREAM_PRINT_VAR_VAL ( var)     #var << " :\n" << var

◆ stringify

#define stringify ( string)    #string

◆ WARNING

#define WARNING ( var)