TrueReality  v0.1.1912
trUtil Namespace Reference

Namespace that holds various utility classes for the engine. More...

Namespaces

 Bits
 
 Console
 
 DefaultSettings
 
 JSON
 
 Logging
 
 Math
 
 PathUtils
 
 StringUtils
 

Classes

struct  AppendTL
 
struct  AppendTL< NullType, T >
 
class  ApplicationUsage
 An application usage class for the argument parser. More...
 
class  ArgumentParser
 A a command line argument parser class that helps to create, manage, and pass commands to other systems. More...
 
struct  CallParms
 
struct  CallParms< TYPELIST_1(P1)>
 A call parameters. More...
 
struct  CallParms< TYPELIST_2(P1, P2)>
 A call parameters. More...
 
struct  CallParms< TYPELIST_3(P1, P2, P3)>
 A call parameters. More...
 
struct  CallParms< TYPELIST_4(P1, P2, P3, P4)>
 A call parameters. More...
 
struct  CallParms< TYPELIST_5(P1, P2, P3, P4, P5)>
 A call parameters. More...
 
struct  CallParms< TYPELIST_6(P1, P2, P3, P4, P5, P6)>
 A call parameters. More...
 
struct  CallParms< TYPELIST_7(P1, P2, P3, P4, P5, P6, P7)>
 A call parameters. More...
 
struct  CreateIdsTL
 
struct  CreateIdsTL<-1, -1, -1, -1, -1, -1, -1, -1 >
 
struct  CreateTL
 
struct  CreateTL< NullType, NullType, NullType, NullType, NullType, NullType, NullType, NullType >
 
class  DateTime
 
class  DirectoryPush
 Simple class to change directory where it automatically pop back out on destruction. More...
 
struct  EmptyType
 
class  EnumerationNumeric
 This class represents a type-safe Enumeration pattern. More...
 
class  EnumerationPointer
 EnumerationString Pointer class holds a reference to a passed in Enumeration. More...
 
class  EnumerationString
 This class represents a type-safe EnumerationString pattern. More...
 
class  EnvVariables
 Disable warning for stl classes Needs to have dll-interface to be used by clients of class. More...
 
class  Exception
 This is the exception class used throughout the engine. More...
 
class  ExceptionInvalidParameter
 Exception used for methods invalid parameters. More...
 
struct  FileInfo
 struct holding information about a file. More...
 
class  FileNotFoundException
 Exception for signalling file not found errors. More...
 
class  FileUtilIOException
 Exception for signaling file utility i/o errors. More...
 
class  FileUtils
 Singleton class implementing basic file operations. More...
 
class  Functor
 A functor. More...
 
struct  FunctorCall
 
struct  FunctorCall< CallType, R, TYPELIST_1(P1)>
 A functor call. More...
 
struct  FunctorCall< CallType, R, TYPELIST_2(P1, P2)>
 A functor call. More...
 
struct  FunctorCall< CallType, R, TYPELIST_3(P1, P2, P3)>
 A functor call. More...
 
struct  FunctorCall< CallType, R, TYPELIST_4(P1, P2, P3, P4)>
 A functor call. More...
 
struct  FunctorCall< CallType, R, TYPELIST_5(P1, P2, P3, P4, P5)>
 A functor call. More...
 
struct  FunctorCall< CallType, R, TYPELIST_6(P1, P2, P3, P4, P5, P6)>
 A functor call. More...
 
struct  FunctorCall< CallType, R, TYPELIST_7(P1, P2, P3, P4, P5, P6, P7)>
 A functor call. More...
 
struct  FunTraits
 Function traits. More...
 
struct  FunTraits< R(*)()>
 
struct  FunTraits< R(*)(P1)>
 
struct  FunTraits< R(*)(P1, P2)>
 
struct  FunTraits< R(*)(P1, P2, P3)>
 
struct  FunTraits< R(*)(P1, P2, P3, P4)>
 
struct  FunTraits< R(*)(P1, P2, P3, P4, P5)>
 
struct  FunTraits< R(*)(P1, P2, P3, P4, P5, P6)>
 
struct  FunTraits< R(*)(P1, P2, P3, P4, P5, P6, P7)>
 
struct  FunTraits< R(O::*)() const >
 
struct  FunTraits< R(O::*)()>
 
struct  FunTraits< R(O::*)(P1) const >
 
struct  FunTraits< R(O::*)(P1)>
 
struct  FunTraits< R(O::*)(P1, P2) const >
 
struct  FunTraits< R(O::*)(P1, P2)>
 
struct  FunTraits< R(O::*)(P1, P2, P3) const >
 
struct  FunTraits< R(O::*)(P1, P2, P3)>
 
struct  FunTraits< R(O::*)(P1, P2, P3, P4) const >
 
struct  FunTraits< R(O::*)(P1, P2, P3, P4)>
 
struct  FunTraits< R(O::*)(P1, P2, P3, P4, P5) const >
 
struct  FunTraits< R(O::*)(P1, P2, P3, P4, P5)>
 
struct  FunTraits< R(O::*)(P1, P2, P3, P4, P5, P6) const >
 
struct  FunTraits< R(O::*)(P1, P2, P3, P4, P5, P6)>
 
struct  FunTraits< R(O::*)(P1, P2, P3, P4, P5, P6, P7) const >
 
struct  FunTraits< R(O::*)(P1, P2, P3, P4, P5, P6, P7)>
 
struct  hash
 This Hash class and its implementations are taken from the libstdc++ hash_fun.h. More...
 
struct  hash< _Key * >
 
struct  hash< char * >
 
struct  hash< char >
 A hash. More...
 
struct  hash< const char * >
 
struct  hash< const std::string >
 A string>. More...
 
struct  hash< const trBase::UniqueId >
 Hash function for hashing const trBase::UniqueId. More...
 
struct  hash< const trUtil::RefStr >
 
struct  hash< int >
 A hash. More...
 
struct  hash< long >
 A hash. More...
 
struct  hash< osg::ref_ptr< _Key > >
 Hash function for hashing osg::ref_ptr. More...
 
struct  hash< short >
 A hash. More...
 
struct  hash< signed char >
 A hash. More...
 
struct  hash< std::string >
 A string>. More...
 
struct  hash< trBase::SmrtPtr< _Key > >
 Hash function for hashing trBase::SmrtPtr. More...
 
struct  hash< trBase::UniqueId >
 Hash function for hashing trBase::UniqueId. More...
 
struct  hash< trUtil::RefStr >
 
struct  hash< unsigned char >
 A hash. More...
 
struct  hash< unsigned int >
 A hash. More...
 
struct  hash< unsigned long >
 A hash. More...
 
struct  hash< unsigned short >
 A hash. More...
 
struct  HashEqual
 
class  HashMap
 
class  HashMultiMap
 
struct  IdsFromTL
 
struct  IdsFromTL< NullType, i >
 
struct  InstantiateH
 
struct  InstantiateH< NullType, Holder, i >
 
struct  InstantiateH< TypeList< T, U >, Holder, i >
 
struct  InstantiateHAccessor
 
struct  InstantiateHAccessor< 0, InstantiateH< TypeList< T, U >, Holder, i >, i >
 
struct  InstantiateHAccessor< j, InstantiateH< TypeList< T, U >, Holder, i >, i >
 
struct  Int2Type
 
class  IsFileSeparator
 
struct  IsIntType
 
struct  IsIntType< Int2Type< i >, i >
 
class  IsPathSeparator
 For tokenizing paths. More...
 
struct  Length
 
struct  Length< NullType >
 
struct  Length< TypeList< T, U > >
 
struct  NotIntType
 
class  NullType
 A null type class. More...
 
class  RefStr
 A string wrapper that will make sure that all of the strings with the same value will point to the same memory. More...
 
struct  Select
 
struct  Select< false, T, U >
 
struct  TailAt
 
struct  TailAt< InstantiateH< TypeList< T, U >, Holder, i >, 0, i >
 
struct  TailAt< InstantiateH< TypeList< T, U >, Holder, i >, j, i >
 
class  Timer
 Timer class is used for measuring elapsed time or time between two points. More...
 
class  ToLowerClass
 
struct  TupleHolder
 
struct  TypeAt
 
struct  TypeAt< TypeList< T, U >, 0 >
 
struct  TypeAt< TypeList< T, U >, i >
 
struct  TypeAtNonStrict
 
struct  TypeAtNonStrict< TypeList< T, U >, 0, DefType >
 
struct  TypeAtNonStrict< TypeList< T, U >, i, DefType >
 
struct  TypeList
 List of types structure. More...
 
struct  UnaryFunction
 A unary function created to have a compatibility to the old std::unary_function while still using c++17. More...
 
class  VersionUtil
 A utility to read and control the engines version numbers. More...
 

Typedefs

using DirectoryContents = std::vector< std::string >
 
using FileExtensionList = std::vector< std::string >
 
using TimeTicks = unsigned long long
 64bit Integer to hold the Timers time ticks. More...
 

Enumerations

enum  FileType { FILE_NOT_FOUND, REGULAR_FILE, DIRECTORY, ARCHIVE }
 Values that represent file types. More...
 

Functions

TR_UTIL_EXPORT std::ostream & operator<< (std::ostream &os, const EnumerationString &e)
 Helper method to print EnumerationNumeric to an output stream. More...
 
TR_UTIL_EXPORT std::ostream & operator<< (std::ostream &o, const Exception &ex)
 Stream insertion operator. More...
 
template<typename CallType >
Functor< typename trUtil::FunTraits< CallType >::ResultType, typename trUtil::FunTraits< CallType >::TypeListType > MakeFunctor (CallType fun)
 Constructor. More...
 
template<typename CallType , class PObj >
Functor< typename trUtil::FunTraits< CallType >::ResultType, typename trUtil::FunTraits< CallType >::TypeListType > MakeFunctor (CallType memfun, PObj *const pobj)
 Constructor. More...
 
template<typename CallType , class Fun >
Functor< typename trUtil::FunTraits< CallType >::ResultType, typename trUtil::FunTraits< CallType >::TypeListType > MakeFunctor (Fun const &fun)
 Constructor. More...
 
template<typename CallType , class PObj >
Functor< typename trUtil::FunTraits< CallType >::ResultType, typename trUtil::FunTraits< CallType >::TypeListType > MakeFunctor (CallType memfun, PObj &pobj)
 Constructor. More...
 
size_t __hash_string (const char *__s)
 Hash string. More...
 
bool operator== (const std::string &s1, const RefStr &s2)
 
std::string operator+ (const std::string &s1, const RefStr &s2)
 
bool operator!= (const std::string &s1, const RefStr &s2)
 
TR_UTIL_EXPORT std::ostream & operator<< (std::ostream &stream, const RefStr &rs)
 
void TR_UTIL_EXPORT AppSleep (unsigned int milliseconds)
 Puts the current application thread to sleep for a given number of milliseconds. More...
 
template<unsigned int j, class Instantiated >
InstantiateHAccessor< j, Instantiated, Instantiated::ordern >::TargetHolder & GetH (Instantiated &h)
 
template<unsigned int j, class Instantiated >
InstantiateHAccessor< j, Instantiated, Instantiated::ordern >::TargetHolder const & GetH (Instantiated const &h)
 
std::ostream & operator<< (std::ostream &os, const EnumerationNumeric &e)
 
static std::string GetPathRoot (const std::string &path)
 
static bool iMakeDirectory (const std::string &path)
 
std::string getFileExtensionIncludingDot (const std::string &fileName)
 

Variables

const BuildType TR_BUILD_TYPE = BuildType::RELEASE
 Defines TR Build Types. More...
 
static size_t StringCount = 0
 
static OpenThreads::Mutex gStringSetMutex
 
static std::set< std::string > StringSet
 

Detailed Description

Namespace that holds various utility classes for the engine.

Disable visual C++ compiler warnings that seem to indicate the compiler is getting confused when compiling an EnumerationString.

Typedef Documentation

◆ DirectoryContents

using trUtil::DirectoryContents = typedef std::vector<std::string>

Definition at line 60 of file FileUtils.h.

◆ FileExtensionList

using trUtil::FileExtensionList = typedef std::vector<std::string>

Definition at line 61 of file FileUtils.h.

◆ TimeTicks

using trUtil::TimeTicks = typedef unsigned long long

64bit Integer to hold the Timers time ticks.

Definition at line 42 of file Timer.h.

Enumeration Type Documentation

◆ FileType

Values that represent file types.

Enumerator
FILE_NOT_FOUND 
REGULAR_FILE 
DIRECTORY 
ARCHIVE 

Definition at line 68 of file FileUtils.h.

Function Documentation

◆ __hash_string()

◆ AppSleep()

void trUtil::AppSleep ( unsigned int  milliseconds)

Puts the current application thread to sleep for a given number of milliseconds.

Returns
A TR_UTIL_EXPORT.
Parameters
millisecondsThe milliseconds.
Author
Maxim Serebrennik

Definition at line 30 of file Timer.cpp.

◆ getFileExtensionIncludingDot()

std::string trUtil::getFileExtensionIncludingDot ( const std::string &  fileName)

Definition at line 876 of file FileUtils.cpp.

Referenced by trUtil::FileUtils::DirGetFiles().

Here is the caller graph for this function:

◆ GetH() [1/2]

template<unsigned int j, class Instantiated >
InstantiateHAccessor<j, Instantiated, Instantiated::ordern>::TargetHolder& trUtil::GetH ( Instantiated &  h)
inline

Definition at line 242 of file TypeList.h.

◆ GetH() [2/2]

template<unsigned int j, class Instantiated >
InstantiateHAccessor<j, Instantiated, Instantiated::ordern>::TargetHolder const& trUtil::GetH ( Instantiated const &  h)
inline

Definition at line 248 of file TypeList.h.

◆ GetPathRoot()

static std::string trUtil::GetPathRoot ( const std::string &  path)
static

Definition at line 109 of file FileUtils.cpp.

Referenced by trUtil::FileUtils::RelativePath().

Here is the caller graph for this function:

◆ iMakeDirectory()

static bool trUtil::iMakeDirectory ( const std::string &  path)
static

Definition at line 121 of file FileUtils.cpp.

References S_ISDIR, and stat64.

Referenced by trUtil::FileUtils::MakeDirectory().

Here is the caller graph for this function:

◆ MakeFunctor() [1/4]

template<typename CallType >
trUtil::MakeFunctor ( CallType  fun)
inline

Constructor.

Parameters
funThe fun.

Definition at line 288 of file Functor.h.

Referenced by trManager::DirectorBase::BuildInvokables(), and trManager::ActorBase::BuildInvokables().

Here is the caller graph for this function:

◆ MakeFunctor() [2/4]

template<typename CallType , class PObj >
trUtil::MakeFunctor ( CallType  memfun,
PObj *const  pobj 
)
inline

Constructor.

Parameters
memfunThe memfun.
[in,out]pobjIf non-null, the pobj.

Definition at line 303 of file Functor.h.

◆ MakeFunctor() [3/4]

template<typename CallType , class Fun >
trUtil::MakeFunctor ( Fun const &  fun)
inline

Constructor.

Parameters
funThe fun.

Definition at line 317 of file Functor.h.

◆ MakeFunctor() [4/4]

template<typename CallType , class PObj >
trUtil::MakeFunctor ( CallType  memfun,
PObj &  pobj 
)
inline

Constructor.

Parameters
memfunThe memfun.
[in,out]pobjThe pobj.

Definition at line 332 of file Functor.h.

◆ operator!=()

bool trUtil::operator!= ( const std::string &  s1,
const RefStr s2 
)
inline

Definition at line 199 of file RefStr.h.

References operator<<().

Referenced by trUtil::EnumerationString::operator!=(), and trUtil::EnumerationNumeric::operator!=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator+()

std::string trUtil::operator+ ( const std::string &  s1,
const RefStr s2 
)
inline

Definition at line 193 of file RefStr.h.

References trUtil::RefStr::Get().

Referenced by trUtil::RefStr::operator const std::string &().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator<<() [1/4]

std::ostream& trUtil::operator<< ( std::ostream &  os,
const EnumerationNumeric e 
)

Definition at line 73 of file EnumerationNumeric.cpp.

References trUtil::EnumerationNumeric::GetID(), and trUtil::EnumerationString::GetName().

Here is the call graph for this function:

◆ operator<<() [2/4]

TR_UTIL_EXPORT std::ostream & trUtil::operator<< ( std::ostream &  o,
const Exception ex 
)

Stream insertion operator.

Parameters
[in,out]oThe std::ostream to process.
exThe ex.
Returns
The shifted result.

Definition at line 106 of file Exception.cpp.

References trUtil::Exception::ToString().

Here is the call graph for this function:

◆ operator<<() [3/4]

std::ostream & trUtil::operator<< ( std::ostream &  stream,
const RefStr rs 
)

Definition at line 172 of file RefStr.cpp.

References trUtil::RefStr::Get().

Here is the call graph for this function:

◆ operator<<() [4/4]

std::ostream & trUtil::operator<< ( std::ostream &  os,
const EnumerationString e 
)

Helper method to print EnumerationNumeric to an output stream.

Helper method to print EnumerationStrings to an output stream.

Parameters
[in,out]osThe operating system.
eThe EnumerationString to process.
Returns
The shifted result.

Definition at line 82 of file EnumerationString.cpp.

References trUtil::EnumerationString::GetName().

Referenced by operator!=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator==()

bool trUtil::operator== ( const std::string &  s1,
const RefStr s2 
)
inline

Definition at line 187 of file RefStr.h.

Referenced by trUtil::EnumerationString::operator!=(), and trUtil::EnumerationNumeric::operator!=().

Here is the caller graph for this function:

Variable Documentation

◆ gStringSetMutex

OpenThreads::Mutex trUtil::gStringSetMutex
static

Definition at line 53 of file RefStr.cpp.

◆ StringCount

size_t trUtil::StringCount = 0
static

◆ StringSet

std::set<std::string> trUtil::StringSet
static

Definition at line 63 of file RefStr.cpp.

◆ TR_BUILD_TYPE

const BuildType trUtil::TR_BUILD_TYPE = BuildType::RELEASE

Defines TR Build Types.

Definition at line 52 of file PlatformMacros.h.

Referenced by trUtil::Console::Logo(), and trUtil::DefaultSettings::SetupLoggingOptions().