Laelaps  2.3.5
RoadNarrows Robotics Small Outdoor Mobile Robot Project
DiagStats Class Reference

Simple diagnostics statistics class. More...

#include <laelaps_diag.h>

Public Member Functions

 DiagStats ()
 Constructor.
 
 ~DiagStats ()
 Destructor.
 
void zero ()
 Zero statistics.
 
DiagStatsoperator+= (const DiagStats &rhs)
 Compound assignment operator. More...
 

Public Attributes

int passCnt
 
int testCnt
 
bool fatal
 

Friends

DiagStats operator+ (DiagStats lhs, const DiagStats &rhs)
 Addition operator. More...
 

Detailed Description

Simple diagnostics statistics class.

Definition at line 106 of file laelaps_diag.h.

Member Function Documentation

DiagStats& DiagStats::operator+= ( const DiagStats rhs)
inline

Compound assignment operator.

A compound assignment (does not need to be a member, but often is, to modify any private members). The addition of rhs to *this takes place here.

Parameters
rhsRight hand side object.
Returns
*this.

Definition at line 149 of file laelaps_diag.h.

150  {
151  passCnt += rhs.passCnt;
152  testCnt += rhs.testCnt;
153  fatal = rhs.fatal;
154  return *this;
155  }

Friends And Related Function Documentation

DiagStats operator+ ( DiagStats  lhs,
const DiagStats rhs 
)
friend

Addition operator.

Friends defined inside class body are inline and are hidden from non-ADL lookup (Argument-Dependent Lookup). Passing lhs by value helps optimize chained a+b+c. Otherwise, both parameters may be const references.

Parameters
lhsLeft hand side lvalue.
rhsRight hand side object.
Returns
*this.

Definition at line 169 of file laelaps_diag.h.

171  {
172  lhs += rhs; // reuse compound assignment
173  return lhs;
174  }

The documentation for this class was generated from the following file: