feisty meow concerns codebase  2.140
basis::outcome Class Reference

Outcomes describe the state of completion for an operation. More...

#include <outcome.h>

Public Member Functions

 outcome (int value=0)
 Represents the completion of an operation as a particular "value". More...
 
 ~outcome ()
 destructor resets outcome value. More...
 
bool equal_to (const outcome &to_compare) const
 Returns true if this outcome is equal to "to_compare". More...
 
bool operator== (int to_compare) const
 Returns true if this outcome is equal to the integer "to_compare". More...
 
int value () const
 
int packed_size () const
 a convenience function for those packing outcomes. More...
 

Detailed Description

Outcomes describe the state of completion for an operation.

These are an extremely simple representation of a non-exceptional exit value as an integer. The range of expression is from 0 to MAXINT. Outcomes are meant to represent the category of 'how' the operation completed; they do not carry along any results of 'what' was produced.

Definition at line 30 of file outcome.h.

Constructor & Destructor Documentation

◆ outcome()

basis::outcome::outcome ( int  value = 0)
inline

Represents the completion of an operation as a particular "value".

The outcomes partition the input space of the operation and represent the different conclusions possible during processing. Values for outcomes must be maintained on a system-wide basis as unique identifiers for them to be meaningful. Note that zero is reserved as a default outcome value. This usually translates to an outcome of OKAY.

Definition at line 33 of file outcome.h.

◆ ~outcome()

basis::outcome::~outcome ( )
inline

destructor resets outcome value.

Definition at line 40 of file outcome.h.

Member Function Documentation

◆ equal_to()

bool basis::outcome::equal_to ( const outcome to_compare) const
inline

Returns true if this outcome is equal to "to_compare".

comparisons between outcomes will operate properly provided that all system-wide outcome values are unique.

Definition at line 42 of file outcome.h.

◆ operator==()

bool basis::outcome::operator== ( int  to_compare) const
inline

Returns true if this outcome is equal to the integer "to_compare".

Definition at line 47 of file outcome.h.

◆ packed_size()

int basis::outcome::packed_size ( ) const
inline

a convenience function for those packing outcomes.

this is inconveniently hard-coded, since packing is only available in the structures library and not at the base.

Definition at line 54 of file outcome.h.

Referenced by octopi::unhandled_request::packed_size().

◆ value()


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