casa::PlotLogMeasurement Class Reference

Used to report time and memory measurements. More...

#include <PlotLogger.h>

Inheritance diagram for casa::PlotLogMeasurement:
casa::PlotLogMessage

List of all members.

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)
 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.

Detailed Description

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.


Member Enumeration Documentation

Available memory units.

Enumerator:
BYTE 
KILOBYTE 
MEGABYTE 

Definition at line 103 of file PlotLogger.h.

Static //.

Available time units. Currently only seconds because that's all that C++ natively supports.

Enumerator:
SECOND 

Definition at line 98 of file PlotLogger.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.


Member Data Documentation

Definition at line 110 of file PlotLogger.h.

Default units.

Definition at line 109 of file PlotLogger.h.

Definition at line 173 of file PlotLogger.h.

Memory unit.

Definition at line 179 of file PlotLogger.h.

Start memory.

Definition at line 170 of file PlotLogger.h.

Start time.

Definition at line 167 of file PlotLogger.h.

Time and memory differences.

Definition at line 173 of file PlotLogger.h.

Time unit.

Definition at line 176 of file PlotLogger.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1