Used to report time and memory measurements. More...
#include <PlotLogger.h>
Public Types | |
| enum | TimeUnit { SECOND } |
Static //. More... | |
| enum | MemoryUnit { BYTE, KILOBYTE, MEGABYTE } |
Available memory units. More... | |
Public Member Functions | |
| PlotLogMeasurement (const String &origin1, const String &origin2, TimeUnit timeUnit=DEFAULT_TIME_UNIT, MemoryUnit memoryUnit=DEFAULT_MEMORY_UNIT, int eventType=DEFAULT_EVENT_TYPE) | |
| Non-Static //. | |
| PlotLogMeasurement (const PlotLogMeasurement ©) | |
| Copy constructor. | |
| ~PlotLogMeasurement () | |
| Destructor. | |
| time_t | startTime () const |
| Returns the time/memory when the measurement started. | |
| unsigned int | startMemory () const |
| double | time () const |
| Returns the time/memory difference between when the measurement started and when the measurement ended. | |
| double | memory () const |
| TimeUnit | timeUnit () const |
| Returns the time/memory units for this measurement. | |
| MemoryUnit | memoryUnit () const |
| void | startMeasurement () |
| Starts the measurement by setting the start time and memory. | |
| void | stopMeasurement () |
| Calculates the measurements from the last starting point to this point, and generates the log message. | |
Static Public Member Functions | |
| static String | timeUnits (TimeUnit t) |
| Get a string representation of the given time/memory unit. | |
| static String | memoryUnits (MemoryUnit m) |
Static Public Attributes | |
| static const TimeUnit | DEFAULT_TIME_UNIT |
| Default units. | |
| static const MemoryUnit | DEFAULT_MEMORY_UNIT |
Private Attributes | |
| time_t | m_startTime |
| Start time. | |
| unsigned int | m_startMemory |
| Start memory. | |
| double | m_time |
| Time and memory differences. | |
| double | m_memory |
| TimeUnit | m_timeUnit |
| Time unit. | |
| MemoryUnit | m_memoryUnit |
| Memory unit. | |
Used to report time and memory measurements.
This functionality can be accessed either directly with a PlotLogMeasurement object or indirectly through the PlotLogger class. Message is: END.: [time] [timeUnits]. Memory: [memory] [memoryUnits]. If the measurement has not been ended, calls stopMeasurement() first.
Definition at line 92 of file PlotLogger.h.
Available memory units.
Definition at line 103 of file PlotLogger.h.
Static //.
Available time units. Currently only seconds because that's all that C++ natively supports.
Definition at line 98 of file PlotLogger.h.
| casa::PlotLogMeasurement::PlotLogMeasurement | ( | const String & | origin1, | |
| const String & | origin2, | |||
| TimeUnit | timeUnit = DEFAULT_TIME_UNIT, |
|||
| MemoryUnit | memoryUnit = DEFAULT_MEMORY_UNIT, |
|||
| int | eventType = DEFAULT_EVENT_TYPE | |||
| ) |
Non-Static //.
Constructor which takes the origin(s), optional time and memory units, and an optional priority. Also calls startMeasurement().
| casa::PlotLogMeasurement::PlotLogMeasurement | ( | const PlotLogMeasurement & | copy | ) |
Copy constructor.
| casa::PlotLogMeasurement::~PlotLogMeasurement | ( | ) |
Destructor.
| double casa::PlotLogMeasurement::memory | ( | ) | const |
| MemoryUnit casa::PlotLogMeasurement::memoryUnit | ( | ) | const |
| static String casa::PlotLogMeasurement::memoryUnits | ( | MemoryUnit | m | ) | [static] |
| void casa::PlotLogMeasurement::startMeasurement | ( | ) |
Starts the measurement by setting the start time and memory.
Measurement automatically begins when the object is constructed, but can be restarted as desired.
| unsigned int casa::PlotLogMeasurement::startMemory | ( | ) | const |
| time_t casa::PlotLogMeasurement::startTime | ( | ) | const |
Returns the time/memory when the measurement started.
| void casa::PlotLogMeasurement::stopMeasurement | ( | ) |
Calculates the measurements from the last starting point to this point, and generates the log message.
| double casa::PlotLogMeasurement::time | ( | ) | const |
Returns the time/memory difference between when the measurement started and when the measurement ended.
Invalid if the measurement was never started and ended.
| TimeUnit casa::PlotLogMeasurement::timeUnit | ( | ) | const |
Returns the time/memory units for this measurement.
| static String casa::PlotLogMeasurement::timeUnits | ( | TimeUnit | t | ) | [static] |
Get a string representation of the given time/memory unit.
const MemoryUnit casa::PlotLogMeasurement::DEFAULT_MEMORY_UNIT [static] |
Definition at line 110 of file PlotLogger.h.
const TimeUnit casa::PlotLogMeasurement::DEFAULT_TIME_UNIT [static] |
Default units.
Definition at line 109 of file PlotLogger.h.
double casa::PlotLogMeasurement::m_memory [private] |
Definition at line 173 of file PlotLogger.h.
Memory unit.
Definition at line 179 of file PlotLogger.h.
unsigned int casa::PlotLogMeasurement::m_startMemory [private] |
Start memory.
Definition at line 170 of file PlotLogger.h.
time_t casa::PlotLogMeasurement::m_startTime [private] |
Start time.
Definition at line 167 of file PlotLogger.h.
double casa::PlotLogMeasurement::m_time [private] |
Time and memory differences.
Definition at line 173 of file PlotLogger.h.
TimeUnit casa::PlotLogMeasurement::m_timeUnit [private] |
Time unit.
Definition at line 176 of file PlotLogger.h.
1.6.1