outcome Class Reference

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

#include <outcome.h>

List of all members.

Public Member Functions

 outcome (int value=0)
 Represents the completion of an operation as a particular "value".
 ~outcome ()
 destructor resets outcome value.
bool operator== (const outcome &to_compare) const
 Returns true if this outcome is equal to "to_compare".
bool operator!= (const outcome &to_compare) const
 Returns true if this outcome is not equal to "to_compare".
bool operator== (int to_compare) const
 Returns true if this outcome is equal to the integer "to_compare".
bool operator!= (int to_compare) const
 Returns true if this outcome is not equal to the integer "to_compare".
int value () const
void pack (byte_array &packed_form) const
bool unpack (byte_array &packed_form)
int packed_size () const


Detailed Description

Outcomes describe the state of completion for an operation.

NOTE: this class supports packing but is not derived from packable; this is totally intentional. There are absolutely no virtual methods supported by an outcome; it is not intended for extension through inheritance. We would really like the impact of an instantiated outcome object to be about the same as a simple integer.

Definition at line 29 of file outcome.h.


Constructor & Destructor Documentation

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 32 of file outcome.h.

outcome::~outcome (  )  [inline]

destructor resets outcome value.

Definition at line 39 of file outcome.h.


Member Function Documentation

bool outcome::operator== ( 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 41 of file outcome.h.

References _o_value.

bool outcome::operator!= ( const outcome to_compare  )  const [inline]

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

Definition at line 45 of file outcome.h.

References _o_value.

bool outcome::operator== ( int  to_compare  )  const [inline]

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

Definition at line 49 of file outcome.h.

bool outcome::operator!= ( int  to_compare  )  const [inline]

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

Definition at line 52 of file outcome.h.

int outcome::value (  )  const [inline]

void outcome::pack ( byte_array packed_form  )  const

bool outcome::unpack ( byte_array packed_form  ) 

int outcome::packed_size (  )  const [inline]

Definition at line 65 of file outcome.h.

Referenced by unhandled_request::packed_size().


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

Generated on Mon Jul 26 04:23:08 2010 for HOOPLE Libraries by  doxygen 1.5.6