hpp::statistics::SuccessBin Class Reference

This class count the number of success and failure. More...

#include <hpp/statistics/success-bin.hh>

Inheritance diagram for hpp::statistics::SuccessBin:
Collaboration diagram for hpp::statistics::SuccessBin:

List of all members.

Classes

class  Reason
 In case of failure, you can provide a reason. More...

Public Member Functions

 SuccessBin (const bool success, const Reason &r=REASON_UNKNOWN)
 Constructor.
bool isSuccess () const
 Value of the bin.
const Reasonreason () const
 If this bin represents 'failure', returns the reason.
const std::string & reasonString () const
 If this bin represents 'failure', returns the reason as a string.
bool operator== (const SuccessBin &other) const
 Check for equality.
bool operator< (const SuccessBin &other) const
 Comparison.

Static Public Member Functions

static Reason createReason (const std::string &what)
 Create a new Reason.

Static Public Attributes

static const Reason REASON_UNKNOWN
 The default reason for 'failure'.

Detailed Description

This class count the number of success and failure.


Constructor & Destructor Documentation

hpp::statistics::SuccessBin::SuccessBin ( const bool  success,
const Reason r = REASON_UNKNOWN 
)

Constructor.


Member Function Documentation

static Reason hpp::statistics::SuccessBin::createReason ( const std::string &  what) [static]

Create a new Reason.

Parameters:
whatThe text associated with the reason.
bool hpp::statistics::SuccessBin::isSuccess ( ) const

Value of the bin.

Returns:
True is it counts "success", False otherwise.
bool hpp::statistics::SuccessBin::operator< ( const SuccessBin other) const

Comparison.

Returns:
the comparison of their reason id. 'success' has a reason id of INT_MIN.
bool hpp::statistics::SuccessBin::operator== ( const SuccessBin other) const

Check for equality.

Returns:
True if both are 'success' or if they are both 'failure' with the same Reason.
const Reason& hpp::statistics::SuccessBin::reason ( ) const

If this bin represents 'failure', returns the reason.

const std::string& hpp::statistics::SuccessBin::reasonString ( ) const

If this bin represents 'failure', returns the reason as a string.


Member Data Documentation

The default reason for 'failure'.