Accelerated Computation Engine
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
EDebug Class Reference

#include <edebug.h>

Public Types

enum  Token { Quote, NoQuote }
 

Public Member Functions

EDebugoperator<< (Token token)
 
EDebugoperator<< (bool value)
 
EDebugoperator<< (qint8 value)
 
EDebugoperator<< (qint16 value)
 
EDebugoperator<< (qint32 value)
 
EDebugoperator<< (qint64 value)
 
EDebugoperator<< (quint8 value)
 
EDebugoperator<< (quint16 value)
 
EDebugoperator<< (quint32 value)
 
EDebugoperator<< (quint64 value)
 
EDebugoperator<< (float value)
 
EDebugoperator<< (double value)
 
EDebugoperator<< (const char *value)
 
EDebugoperator<< (const void *const value)
 
EDebugoperator<< (const QByteArray &value)
 
EDebugoperator<< (const QString &value)
 
EDebugoperator<< (const QStringList &value)
 
EDebugoperator<< (const QObject *const value)
 
EDebugoperator<< (const QVariant &value)
 
EDebugoperator<< (EAbstractAnalytic::Input::Type value)
 
EDebugoperator<< (EAbstractAnalytic::Input::Role value)
 
EDebugoperator<< (Ace::Analytic::AbstractMPI::Type value)
 
 EDebug (const char *function, const char *argumentNames)
 
 ~EDebug ()
 
template<class... Args>
void setArguments (Args... arguments)
 

Static Public Member Functions

static int threadId ()
 

Protected Member Functions

template<class T >
void setArgument (int depth, T last)
 
template<class T , class... Args>
void setArgument (int depth, T next, Args... arguments)
 

Detailed Description

This is the debug class which is used at the beginning of each function to track every function call for debugging. This class should NEVER be used directly, instead using the macro provided in its header file that declares an instance of this class with the given function variables to report. This class is aware of threads, correctly reporting what thread each debug message is on so the correct stack debug flow of function calls is presented for each separate thread. A unique ID is given to each new thread.

This class also acts as a stream operator for any variable type that is passed to it from the list of arguments for a function call. Only literal types should be copied. Any other abstract or object type MUST be passed by pointer. The stream's properties can be modified by streaming special tokens to it.

The stream operators are not used in a classical sense of a streaming object, since this debug object is not a basic IO stream. Instead the stream operators construct the values of any passed function arguments that it then uses for debug output. Because of the temporary nature each variable is streamed into the same string, overwritten each time a new variable is streamed into it.

Member Enumeration Documentation

◆ Token

Defines special tokens for setting different properties of this debug object's stream.

Enumerator
Quote 

Sets the quote property active which will add quotes to any input lines following this token. This is the default behavior.

Sets the quote property inactive appending any input strings as is following this token.

Constructor & Destructor Documentation

◆ EDebug()

EDebug::EDebug ( const char *  function,
const char *  argumentNames 
)

Constructs a new debug object with the given function name and list of argument names. The argument names are expected to be separated by commas.

Parameters
functionThe name of the function that is being entered and this new debug object is responsible for tracking.
argumentNamesThe list of argument names for this new debug object's tracked function. The names must be separated by commas.

◆ ~EDebug()

EDebug::~EDebug ( )

Cleans up a debug object that has fallen out of scope of its tracking function along with reporting the function has been left.

Member Function Documentation

◆ operator<<() [1/22]

EDebug & EDebug::operator<< ( Token  token)

Modifies a property of this debug object's streaming properties.

Parameters
tokenThe token that is used to modify a property of this debug object's stream.
Returns
Reference to this debug object.

◆ operator<<() [2/22]

EDebug & EDebug::operator<< ( bool  value)

Writes a boolean value to this debug thread's temporary stream object as a string.

Parameters
valueThe boolean value written as a string.
Returns
Reference to this debug object.

◆ operator<<() [3/22]

EDebug & EDebug::operator<< ( qint8  value)

Writes an integer value to this debug thread's temporary stream object as a string.

Parameters
valueThe integer value written as a string.
Returns
Reference to this debug object.

◆ operator<<() [4/22]

EDebug & EDebug::operator<< ( qint16  value)

Writes an integer value to this debug thread's temporary stream object as a string.

Parameters
valueThe integer value written as a string.
Returns
Reference to this debug object.

◆ operator<<() [5/22]

EDebug & EDebug::operator<< ( qint32  value)

Writes an integer value to this debug thread's temporary stream object as a string.

Parameters
valueThe integer value written as a string.
Returns
Reference to this debug object.

◆ operator<<() [6/22]

EDebug & EDebug::operator<< ( qint64  value)

Writes an integer value to this debug thread's temporary stream object as a string.

Parameters
valueThe integer value written as a string.
Returns
Reference to this debug object.

◆ operator<<() [7/22]

EDebug & EDebug::operator<< ( quint8  value)

Writes an integer value to this debug thread's temporary stream object as a string.

Parameters
valueThe integer value written as a string.
Returns
Reference to this debug object.

◆ operator<<() [8/22]

EDebug & EDebug::operator<< ( quint16  value)

Writes an integer value to this debug thread's temporary stream object as a string.

Parameters
valueThe integer value written as a string.
Returns
Reference to this debug object.

◆ operator<<() [9/22]

EDebug & EDebug::operator<< ( quint32  value)

Writes an integer value to this debug thread's temporary stream object as a string.

Parameters
valueThe integer value written as a string.
Returns
Reference to this debug object.

◆ operator<<() [10/22]

EDebug & EDebug::operator<< ( quint64  value)

Writes an integer value to this debug thread's temporary stream object as a string.

Parameters
valueThe integer value written as a string.
Returns
Reference to this debug object.

◆ operator<<() [11/22]

EDebug & EDebug::operator<< ( float  value)

Writes a floating point value to this debug thread's temporary stream object as a string.

Parameters
valueThe value written as a string.
Returns
Reference to this debug object.

◆ operator<<() [12/22]

EDebug & EDebug::operator<< ( double  value)

Writes a floating point value to this debug thread's temporary stream object as a string.

Parameters
valueThe value written as a string.
Returns
Reference to this debug object.

◆ operator<<() [13/22]

EDebug & EDebug::operator<< ( const char *  value)

Writes a string to this debug thread's temporary stream object. Quotes are added if that property is active.

Parameters
valueThe value written as a string.
Returns
Reference to this debug object.

◆ operator<<() [14/22]

EDebug & EDebug::operator<< ( const void *const  value)

Writes a pointer value to this debug thread's temporary stream object as a string.

Parameters
valueThe value written as a string.
Returns
Reference to this debug object.

◆ operator<<() [15/22]

EDebug & EDebug::operator<< ( const QByteArray &  value)

Writes a byte array value to this debug thread's temporary stream object as a string.

Parameters
valueThe value written as a string.
Returns
Reference to this debug object.

◆ operator<<() [16/22]

EDebug & EDebug::operator<< ( const QString &  value)

Writes a Qt string value to this debug thread's temporary stream object.

Parameters
valueThe value written as a string.
Returns
Reference to this debug object.

◆ operator<<() [17/22]

EDebug & EDebug::operator<< ( const QStringList &  value)

Writes a list of Qt strings to this debug thread's temporary stream object as a single string.

Parameters
valueThe value written as a string.
Returns
Reference to this debug object.

◆ operator<<() [18/22]

EDebug & EDebug::operator<< ( const QObject *const  value)

Writes a Qt object pointer to this debug thread's temporary stream object as a string.

Parameters
valueThe value written as a string.
Returns
Reference to this debug object.

◆ operator<<() [19/22]

EDebug & EDebug::operator<< ( const QVariant &  value)

Writes a qt variant value to this debug thread's temporary stream object as a string.

Parameters
valueThe value written as a string.
Returns
Reference to this debug object.

◆ operator<<() [20/22]

EDebug & EDebug::operator<< ( EAbstractAnalytic::Input::Type  value)

Writes an abstract analytic input type enumeration value to this debug thread's temporary stream object as a string.

Parameters
valueThe value written as a string.
Returns
Reference to this debug object.

◆ operator<<() [21/22]

EDebug & EDebug::operator<< ( EAbstractAnalytic::Input::Role  value)

Writes an abstract analytic input role enumeration value to this debug thread's temporary stream object as a string.

Parameters
valueThe value written as a string.
Returns
Reference to this debug object.

◆ operator<<() [22/22]

EDebug & EDebug::operator<< ( Ace::Analytic::AbstractMPI::Type  value)

Writes an ace analytic abstract MPI type enumeration value to this debug thread's temporary stream object as a string.

Parameters
valueThe value written as a string.
Returns
Reference to this debug object.

◆ setArgument() [1/2]

template<class T >
void EDebug::setArgument ( int  depth,
last 
)
protected

Sets the final argument value for the variadic function chain.

Template Parameters
TThe type of the last argument value.
Parameters
depthThe depth of the last argument which is the nth argument value.
lastThe last argument.

◆ setArgument() [2/2]

template<class T , class... Args>
void EDebug::setArgument ( int  depth,
next,
Args...  arguments 
)
protected

Sets the next argument value for the variadic function chain.

Template Parameters
TThe type of the next argument value.
ArgsThe variadic list of remaining argument values.
Parameters
depthThe depth of the next argument which is the nth argument value.
nextThe next argument value.
argumentsThe variadic list of remaining argument values.

◆ setArguments()

template<class... Args>
void EDebug::setArguments ( Args...  arguments)

Sets the value of the arguments of the function this debug object is tracking. The number of arguments MUST match with the number of argument names given in this object's constructor.

Template Parameters
ArgsThe variadic list of argument values.
Parameters
argumentsThe variadic list of argument values.

◆ threadId()

int EDebug::threadId ( )
static

Returns the unique integer thread ID of the caller of this function.

Returns
Unique integer thread ID.

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