# Frost::UtilsManager Class Reference

Manages base functions (log...). More...

`#include <frost_utilsmanager.h>`

Inheritance diagram for Frost::UtilsManager:

List of all members.

## Public Types

typedef void(* | LogFunction )(const s_str &, const s_bool &, const s_uint &)

## Public Member Functions

void | Initialize ()
| Initializes this manager.
void | SetLogFunction (LogFunction pFunc)
| Sets the log function to use.
void | Log (const s_str &sMessage, const s_bool &bTimeStamps, const s_uint &uiOffset)
| Shortcut to the user specified log function.
void | SetLogLevel (const s_uint &uiLevel)
| Sets the highest log level allowed for all following messages.
const s_uint & | GetLogLevel () const
| Returns the current highest log level allowed.

## Static Public Attributes

static const s_str | CLASS_NAME = "UtilsManager"

## Protected Member Functions

| UtilsManager ()
| Default constructor.
virtual | ~UtilsManager ()
| Destructor.
| UtilsManager (const UtilsManager &mMgr)
| Copy constructor.
UtilsManager & | operator= (const UtilsManager &mMgr)
| Assignment operator.

## Private Attributes

LogFunction | pLogFunction_
s_uint | uiLogLevel_

## Friends

class | Manager< UtilsManager >

## Detailed Description

Manages base functions (log...).

Definition at line 18 of file frost_utilsmanager.h.

## Member Typedef Documentation

typedef void(* Frost::UtilsManager::LogFunction)(const s_str &, const s_bool &, const s_uint &)

Definition at line 23 of file frost_utilsmanager.h.

## Constructor & Destructor Documentation

Frost::UtilsManager::UtilsManager | ( |  | ) | `[protected]`

Default constructor.

Note:
  This is a singleton class. That means that there can only be a single instance at the same time. That's why the constructor is not in public scope.
  If you need to get a pointer to that unique instance, call UtilsManager::GetSingleton().
  Note that, if GetSingleton() has been called at least once, you'll have to delete the returned pointer when you close your program by calling UtilsManager::Delete() (this is automatically done by Engine).

Definition at line 23 of file frost_utilsmanager.cpp.

Frost::UtilsManager::~UtilsManager | ( |  | ) | `[protected, virtual]`

Destructor.

Note:
  If GetSingleton() has been called at least once, you'll have to delete the returned pointer when you close your program by calling Delete() (this is automatically done by Engine).

Definition at line 28 of file frost_utilsmanager.cpp.

Frost::UtilsManager::UtilsManager | ( | const UtilsManager & | mMgr | ) | `[protected]`

Copy constructor.

## Member Function Documentation

const s_uint & Frost::UtilsManager::GetLogLevel | ( |  | ) | const

Returns the current highest log level allowed.

Returns:
  The current highest log level allowed

Note:
  See SetLogLevel.

Definition at line 60 of file frost_utilsmanager.cpp.

void Frost::UtilsManager::Initialize | ( |  | ) |

Initializes this manager.

Note:
  Calls srand().

Definition at line 32 of file frost_utilsmanager.cpp.

void Frost::UtilsManager::Log | ( | const s_str & | sMessage,
|  | const s_bool & | bTimeStamps,
|  | const s_uint & | uiOffset |
| ) |  |  |

Shortcut to the user specified log function.

Parameters:

  | sMessage | The message to log
  | bTimeStamps | 'true' to display time stamps
  | uiOffset | The line jump offset

Definition at line 49 of file frost_utilsmanager.cpp.

UtilsManager& Frost::UtilsManager::operator= | ( | const UtilsManager & | mMgr | ) | `[protected]`

Assignment operator.

void Frost::UtilsManager::SetLogFunction | ( | LogFunction | pFunc | ) |

Sets the log function to use.

Parameters:

  | pFunc | The log function

Note:
  This function will be used by Frost::Log(), Frost::Warning() and Frost::Error().
  Its signature must be :
  &nsbp&nsbp&nsbpvoid Func(const s_str&, const s_bool&);
  See UtilsManager::Log() for more infos about these params.

Definition at line 44 of file frost_utilsmanager.cpp.

void Frost::UtilsManager::SetLogLevel | ( | const s_uint & | uiLevel | ) |

Sets the highest log level allowed for all following messages.

Parameters:

  | uiLevel | The new highest level

Note:
  When using Log<5>("blabla"), you specify that this message has a log level of 5. By default, the highest level allowed is 0 : if you want your message to be printed on the log file, you must call SetLogLevel(5) or higher. This allows quick selection of which log messages to print. The admitted convention is that higher level messages are less important or extremely precise, so you may not want them to be printed all the time.

Definition at line 55 of file frost_utilsmanager.cpp.

## Friends And Related Function Documentation

friend class Manager< UtilsManager >`[friend]`

Definition at line 20 of file frost_utilsmanager.h.

## Member Data Documentation

const s_str Frost::UtilsManager::CLASS_NAME = "UtilsManager"`[static]`

Definition at line 66 of file frost_utilsmanager.h.

LogFunction Frost::UtilsManager::pLogFunction_`[private]`

Definition at line 99 of file frost_utilsmanager.h.

s_uint Frost::UtilsManager::uiLogLevel_`[private]`

Definition at line 100 of file frost_utilsmanager.h.

The documentation for this class was generated from the following files:

- D:/Programmation/Sources/Tensor2/Utils/include/frost_utilsmanager.h
- D:/Programmation/Sources/Tensor2/Utils/src/frost_utilsmanager.cpp