Trace System. More...
#include <rtrace.h>
Collaboration diagram for RTrace:
Public Member Functions | |
RTrace (const RString &msg) | |
int | Compare (const RTrace &msg) const |
int | Compare (const RString &msg) const |
bool | operator== (const RTrace &msg) const |
bool | operator== (const RString &msg) const |
~RTrace (void) | |
Static Public Member Functions | |
static RTrace * | LookMsg (const RString &msg) |
static RTrace * | InsertMsg (const RString &msg) |
static void | DeleteMsg (RTrace *msg) |
Private Attributes | |
RString | Msg |
Detailed Description
Trace System.
The RTrace class provides a representation for a message that can be leave by some objects and that can be retrieve by others. This system can be used for debugging purposes to handle inter-dependency problems.
// Library A
#include <rtrace.h>
using namespace R;
void SomeWhereInTheCode(int money)
{
...
if(!money)
RTrace::InsertMsg("Special situation : No money");
...
}
// Library B
#include <rtrace.h>
using namespace R;
void SomeWhereElseInTheCode(void)
{
...
if(msg)
{
cout<<"Put here a breakpoint"<<endl;
RTrace::DeleteMsg(msg); // Situation handled
}
...
}
Constructor & Destructor Documentation
~RTrace | ( | void | ) |
Destruct the message.
Member Function Documentation
int Compare | ( | const RTrace & | msg | ) | const |
Compare two messages by comparing their content.
- See also
- R::RContainer
- Parameters
-
msg Message.
- Returns
- int
int Compare | ( | const RString & | msg | ) | const |
bool operator== | ( | const RTrace & | msg | ) | const |
Equal operator between messages.
- Parameters
-
msg Message.
- Returns
- true if equal, false else.
bool operator== | ( | const RString & | msg | ) | const |
Equal operator between a message and a string.
- Parameters
-
msg RString.
- Returns
- true if equal, false else.
Look after a specific message.
- Parameters
-
msg String.
- Returns
- Pointer to the specific message, or 0 if not found.
Insert a new message.
- Parameters
-
msg String representing the message.
- Returns
- Pointer to the message inserted.
|
static |
Delete a message.
- Parameters
-
msg Message.
Field Documentation
|
private |
The message to trace.