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]

Definition at line 56 of file outcome.h.

Referenced by CHECK_STACK_RESULT(), xml_generator::outcome_name(), scheduling_common::outcome_name(), process_manager::outcome_name(), heavy_file_operations::outcome_name(), common::outcome_name(), spocket::outcome_name(), communication_commons::outcome_name(), cromp_transaction::outcome_name(), cromp_common::outcome_name(), file_transfer_infoton::pack(), cromp_common::send_buffer(), and test_stack_with_objects().

void outcome::pack ( byte_array packed_form  )  const

Definition at line 21 of file outcome.cpp.

References basis::attach().

Referenced by security_infoton::pack(), encryption_infoton::pack(), occurrence::pack(), and unhandled_request::pack().

bool outcome::unpack ( byte_array packed_form  ) 

Definition at line 24 of file outcome.cpp.

References basis::detach().

Referenced by security_infoton::unpack(), encryption_infoton::unpack(), occurrence::unpack(), and unhandled_request::unpack().

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 Wed Jul 23 04:35:24 2008 for HOOPLE Libraries by  doxygen 1.5.1