Scope
General helper function and classes

Classes

class  Active< RT >
 
class  ScopeMessage< T >
 
class  StopCondition
 
struct  Scaler< T >
 
class  scope::ScopeException
 

Macros

#define LODWORD32(l)   ((DWORD32)(((ULONG64)(l)) & 0xffffffff))
 
#define HIDWORD32(l)   ((DWORD32)((((ULONG64)(l)) >> 32) & 0xffffffff))
 
#define DBOUT(s)
 

Enumerations

enum  ScopeMessageTag { nothing, abort }
 

Functions

template<class T >
Signum (const T &_v)
 
template<class Interface >
void SafeRelease (Interface **ppInterfaceToRelease)
 
void scope::ScopeExceptionHandler (const std::string &_origin, const bool &_log=true, const bool &_showmessagebox=false, const bool &_trace=true, const bool &_rethrow=false)
 
void scope::__ScopeExceptionHandlerHelper (const std::string &_msg, const bool &_log, const bool &_showmessagebox, const bool &_trace)
 
void scope::__ScopeExceptionHandlerHelperW (const std::wstring &_msg, const bool &_log, const bool &_showmessagebox, const bool &_trace)
 

Rounding functions

For convenience, round double to whatever

double round (const double &v)
 
uint64_t round2ui64 (const double &v)
 
uint32_t round2ui32 (const double &v)
 
uint16_t round2ui16 (const double &v)
 
uint8_t round2ui8 (const double &v)
 
int64_t round2i64 (const double &v)
 
int32_t round2i32 (const double &v)
 
int16_t round2i16 (const double &v)
 
int8_t round2i8 (const double &v)
 
template<class T >
round2 (const double &v)
 

Date/Time string functions

Provide nice formatting of date or time

std::wstring GetCurrentDateString ()
 
std::wstring GetCurrentTimeString (const bool &_filenamecompatible=true)
 

Detailed Description

Contains various classes and functions.

Macro Definition Documentation

#define LODWORD32 (   l)    ((DWORD32)(((ULONG64)(l)) & 0xffffffff))

Extracts low dword (32 bits) from an ULONG64 (64 bits)

Definition at line 19 of file helpers.h.

#define HIDWORD32 (   l)    ((DWORD32)((((ULONG64)(l)) >> 32) & 0xffffffff))

Extracts high dword (32 bits) from an ULONG64 (64 bits)

Definition at line 21 of file helpers.h.

#define DBOUT (   s)

A debug output to the debug console.

Definition at line 153 of file helpers.h.

Enumeration Type Documentation

enum ScopeMessageTag
strong

Tag for ScopeMessage.

Definition at line 62 of file helpers.h.

Function Documentation

template<class T >
T Signum ( const T &  _v)
Returns
+1 for positive T, -1 for negative T

Definition at line 16 of file helpers.h.

template<class Interface >
void SafeRelease ( Interface **  ppInterfaceToRelease)

A safe release for COM objects.

Definition at line 25 of file helpers.h.

std::wstring GetCurrentDateString ( )
Returns
string with the current date in format YYYY-MM-DD

Definition at line 4 of file helpers.cpp.

std::wstring GetCurrentTimeString ( const bool &  _filenamecompatible = true)
Parameters
[in]_filenamecompatibletrue for compatiblity with file name, returns . instead of : (whichis required by ISO standard)
Returns
string with current time in format HH:MM:SS

Definition at line 12 of file helpers.cpp.

void scope::ScopeExceptionHandler ( const std::string &  _origin,
const bool &  _log = true,
const bool &  _showmessagebox = false,
const bool &  _trace = true,
const bool &  _rethrow = false 
)

Handles all exceptions and does nice logging.

Parameters
[in]_originstring with the origin of the exception
[in]_logtrue for logging to the ScopeLogger
[in]_showmessageboxtrue for displaying a Windows message box with a warning text
[in]_tracetrue for debug output
[in]_rethrowtrue to rethrow the exception after handling in here

Definition at line 8 of file ScopeException.cpp.

void scope::__ScopeExceptionHandlerHelper ( const std::string &  _msg,
const bool &  _log,
const bool &  _showmessagebox,
const bool &  _trace 
)

Helper function that actually handles the logging to the ScopeLogger.

Parameters
[in]_msgstring with the exception's message
[in]_logtrue for logging to the ScopeLogger
[in]_showmessageboxtrue for displaying a Windows message box with a warning text
[in]_tracetrue for debug output

Definition at line 55 of file ScopeException.cpp.

void scope::__ScopeExceptionHandlerHelperW ( const std::wstring &  _msg,
const bool &  _log,
const bool &  _showmessagebox,
const bool &  _trace 
)

Helper function that actually handles the logging to the ScopeLogger (wide string version)

Parameters
[in]_msgstring with the exception's message
[in]_logtrue for logging to the ScopeLogger
[in]_showmessageboxtrue for displaying a Windows message box with a warning text
[in]_tracetrue for debug output

Definition at line 69 of file ScopeException.cpp.