NETWORK ATTACKS FRAMEWORK
1.0.0
A NETwork Attacks framework. Making network attacks impact evaluation easier!
|
Specific logs for MA framework. More...
#include <NA_NesgLog.h>
Public Member Functions | |
NA_NesgLog () | |
Constructor. | |
~NA_NesgLog () | |
Destructor. | |
void | write (const char *logline,...) |
Write a log line in the simulation console. | |
void | unsetLog () |
Deactivate the logs. | |
NA_NesgLog & | operator<< (const std::string &t) |
Override the operator << for strings. | |
template<typename T > | |
NA_NesgLog & | operator<< (const T &t) |
Override the operator << for generic objects. | |
NA_NesgLog & | operator<< (std::ostream &(t)(std::ostream &)) |
Override the operator << for objects like endl. | |
Private Attributes | |
bool | active |
Flag to active the logs or not. |
Specific logs for MA framework.
This class provides some methods and macros to make the debug process easier. An example of use is showed following:
LOG << "Dropping Attack Probability received: "<< dmsg->getDroppingAttackProbability() << "\n";
Definition at line 57 of file NA_NesgLog.h.
NA_NesgLog::~NA_NesgLog | ( | ) | [inline] |
NA_NesgLog& NA_NesgLog::operator<< | ( | const std::string & | t | ) | [inline] |
Override the operator << for strings.
t | the string to write on log |
Definition at line 88 of file NA_NesgLog.h.
{ if (active) EV << t; return *this; } // For strings
NA_NesgLog& NA_NesgLog::operator<< | ( | const T & | t | ) | [inline] |
Override the operator << for generic objects.
t | a generic object to write on log |
Definition at line 100 of file NA_NesgLog.h.
{ if (active) EV << t; return *this; } // For generic objects
NA_NesgLog& NA_NesgLog::operator<< | ( | std::ostream & | t)(std::ostream & | ) | [inline] |
Override the operator << for objects like endl.
t |
Definition at line 112 of file NA_NesgLog.h.
{ if (active) EV << t; return *this; } // For objects like endl
void NA_NesgLog::unsetLog | ( | ) |
void NA_NesgLog::write | ( | const char * | logline, |
... | |||
) |
Write a log line in the simulation console.
logline |
Definition at line 33 of file NA_NesgLog.cc.
{ if (active) { va_list argList; char cbuffer[1024]; va_start(argList, logline); vsnprintf(cbuffer, 1024, logline, argList); va_end(argList); EV << NESGLOGHEADER << cbuffer << endl; } }
bool NA_NesgLog::active [private] |
Flag to active the logs or not.
Definition at line 122 of file NA_NesgLog.h.