Accelerated Computation Engine
|
#include <edebug.h>
Public Types | |
enum | Token { Quote, NoQuote } |
Public Member Functions | |
EDebug & | operator<< (Token token) |
EDebug & | operator<< (bool value) |
EDebug & | operator<< (qint8 value) |
EDebug & | operator<< (qint16 value) |
EDebug & | operator<< (qint32 value) |
EDebug & | operator<< (qint64 value) |
EDebug & | operator<< (quint8 value) |
EDebug & | operator<< (quint16 value) |
EDebug & | operator<< (quint32 value) |
EDebug & | operator<< (quint64 value) |
EDebug & | operator<< (float value) |
EDebug & | operator<< (double value) |
EDebug & | operator<< (const char *value) |
EDebug & | operator<< (const void *const value) |
EDebug & | operator<< (const QByteArray &value) |
EDebug & | operator<< (const QString &value) |
EDebug & | operator<< (const QStringList &value) |
EDebug & | operator<< (const QObject *const value) |
EDebug & | operator<< (const QVariant &value) |
EDebug & | operator<< (EAbstractAnalytic::Input::Type value) |
EDebug & | operator<< (EAbstractAnalytic::Input::Role value) |
EDebug & | operator<< (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) |
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.
enum EDebug::Token |
Defines special tokens for setting different properties of this debug object's stream.
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.
function | The name of the function that is being entered and this new debug object is responsible for tracking. |
argumentNames | The list of argument names for this new debug object's tracked function. The names must be separated by commas. |
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.
Modifies a property of this debug object's streaming properties.
token | The token that is used to modify a property of this debug object's stream. |
EDebug & EDebug::operator<< | ( | bool | value | ) |
Writes a boolean value to this debug thread's temporary stream object as a string.
value | The boolean value written as a string. |
EDebug & EDebug::operator<< | ( | qint8 | value | ) |
Writes an integer value to this debug thread's temporary stream object as a string.
value | The integer value written as a string. |
EDebug & EDebug::operator<< | ( | qint16 | value | ) |
Writes an integer value to this debug thread's temporary stream object as a string.
value | The integer value written as a string. |
EDebug & EDebug::operator<< | ( | qint32 | value | ) |
Writes an integer value to this debug thread's temporary stream object as a string.
value | The integer value written as a string. |
EDebug & EDebug::operator<< | ( | qint64 | value | ) |
Writes an integer value to this debug thread's temporary stream object as a string.
value | The integer value written as a string. |
EDebug & EDebug::operator<< | ( | quint8 | value | ) |
Writes an integer value to this debug thread's temporary stream object as a string.
value | The integer value written as a string. |
EDebug & EDebug::operator<< | ( | quint16 | value | ) |
Writes an integer value to this debug thread's temporary stream object as a string.
value | The integer value written as a string. |
EDebug & EDebug::operator<< | ( | quint32 | value | ) |
Writes an integer value to this debug thread's temporary stream object as a string.
value | The integer value written as a string. |
EDebug & EDebug::operator<< | ( | quint64 | value | ) |
Writes an integer value to this debug thread's temporary stream object as a string.
value | The integer value written as a string. |
EDebug & EDebug::operator<< | ( | float | value | ) |
Writes a floating point value to this debug thread's temporary stream object as a string.
value | The value written as a string. |
EDebug & EDebug::operator<< | ( | double | value | ) |
Writes a floating point value to this debug thread's temporary stream object as a string.
value | The value written as a string. |
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.
value | The value written as a string. |
EDebug & EDebug::operator<< | ( | const void *const | value | ) |
Writes a pointer value to this debug thread's temporary stream object as a string.
value | The value written as a string. |
EDebug & EDebug::operator<< | ( | const QByteArray & | value | ) |
Writes a byte array value to this debug thread's temporary stream object as a string.
value | The value written as a string. |
EDebug & EDebug::operator<< | ( | const QString & | value | ) |
Writes a Qt string value to this debug thread's temporary stream object.
value | The value written as a string. |
EDebug & EDebug::operator<< | ( | const QStringList & | value | ) |
Writes a list of Qt strings to this debug thread's temporary stream object as a single string.
value | The value written as a string. |
EDebug & EDebug::operator<< | ( | const QObject *const | value | ) |
Writes a Qt object pointer to this debug thread's temporary stream object as a string.
value | The value written as a string. |
EDebug & EDebug::operator<< | ( | const QVariant & | value | ) |
Writes a qt variant value to this debug thread's temporary stream object as a string.
value | The value written as a string. |
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.
value | The value written as a string. |
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.
value | The value written as a string. |
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.
value | The value written as a string. |
|
protected |
Sets the final argument value for the variadic function chain.
T | The type of the last argument value. |
depth | The depth of the last argument which is the nth argument value. |
last | The last argument. |
|
protected |
Sets the next argument value for the variadic function chain.
T | The type of the next argument value. |
Args | The variadic list of remaining argument values. |
depth | The depth of the next argument which is the nth argument value. |
next | The next argument value. |
arguments | The variadic list of remaining argument values. |
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.
Args | The variadic list of argument values. |
arguments | The variadic list of argument values. |
|
static |
Returns the unique integer thread ID of the caller of this function.