STIR 6.4.0
stir::Succeeded Class Reference

a class containing an enumeration type that can be used by functions to signal successful operation or not More...

#include "stir/Succeeded.h"

Public Types

enum  value { yes , no }
 

Public Member Functions

 Succeeded (const value &v=yes)
 
bool operator== (const Succeeded &v2) const
 
bool operator!= (const Succeeded &v2) const
 
bool succeeded () const
 convenience function returns if it is equal to Succeeded::yes
 

Detailed Description

a class containing an enumeration type that can be used by functions to signal successful operation or not

Example:

Succeeded f() { do_something; return Succeeded::yes; }
void g() { if (f() == Succeeded::no) error("Error calling f"); }
// the latter can also be written as
void g2() { if (!f().succeeded()) error("Error calling f"); }
bool succeeded() const
convenience function returns if it is equal to Succeeded::yes
Definition Succeeded.h:57
void error(const char *const s,...)
Print error with format string a la printf and throw exception.
Definition error.cxx:42

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