Home

outcome Class Reference
[History]

Defines a class for holding the results of API calls. More...

#include <api.hxx>

Inheritance diagram for outcome:

Inheritance graph
[legend]
Collaboration diagram for outcome:

Collaboration graph
[legend]

List of all members.

Public Member Functions

BULLETIN_BOARDbb () const
 Returns the bulletin board pointer used by this outcome.
void debug (FILE *fp=debug_file_ptr) const
 Outputs information about this outcome to the debug file or to another specified file.
logical encountered_errors () const
 Returns TRUE if the outcome does not represent a successful result or if a fail-safe routine encountered error(s) and continued; otherwise returns FALSE.
err_mess_type error_number () const
 Returns the error number of this outcome.
error_infoget_error_info () const
 Returns a pointer to the fatal error information of this outcome.
void get_error_info_list (error_info_list &errors) const
 Adds into the incoming list error_info_list& errors, all the error_info objects that are stored by this outcome object, including the fatal one that is returned by outcome::get_error_info().
void ignore ()
 Temporarily Ignore the failure of a nested API call.
logical ok () const
 Returns TRUE if this outcome represents a successful result; otherwise, returns FALSE.
outcomeoperator= (const outcome &o)
 Copies state of another outcome into this outcome (assignment operator)

.
 outcome (const outcome &o)
 Constructs one outcome object from another (copy constructor).
 outcome (err_mess_type i=0, error_info *e=NULL)
 Constructs an outcome object from the specified parameters.
void set_bb (BULLETIN_BOARD *bb)
 Sets the bulletin board pointer of this outcome.
 ~outcome ()
 C++ destructor, deleting a outcome.


Detailed Description

Defines a class for holding the results of API calls.


Role: This class contains an error number to indicate the success or failure of the API routine, together with a bulletin board pointer. This class also contains error_info objects which encapsulate errors or problems that the API encountered.

See also:
BULLETIN_BOARD, error_info, error_info_list

Constructor & Destructor Documentation

outcome::outcome ( err_mess_type  i = 0,
error_info e = NULL 
)

Constructs an outcome object from the specified parameters.



Parameters:
i error number.
e pointer to error information.

outcome::outcome ( const outcome o  ) 

Constructs one outcome object from another (copy constructor).



Parameters:
o reference to another outcome.

outcome::~outcome (  ) 

C++ destructor, deleting a outcome.


Member Function Documentation

BULLETIN_BOARD* outcome::bb (  )  const [inline]

Returns the bulletin board pointer used by this outcome.

void outcome::debug ( FILE *  fp = debug_file_ptr  )  const

Outputs information about this outcome to the debug file or to another specified file.



Role: Sends the output to debug_file_ptr if no file is specified.

Parameters:
fp FILE to which the information is to be written (optional).

logical outcome::encountered_errors (  )  const

Returns TRUE if the outcome does not represent a successful result or if a fail-safe routine encountered error(s) and continued; otherwise returns FALSE.

err_mess_type outcome::error_number (  )  const [inline]

Returns the error number of this outcome.

error_info* outcome::get_error_info (  )  const

Returns a pointer to the fatal error information of this outcome.

void outcome::get_error_info_list ( error_info_list errors  )  const

Adds into the incoming list error_info_list& errors, all the error_info objects that are stored by this outcome object, including the fatal one that is returned by outcome::get_error_info().



Parameters:
errors error_info_list to which the error_info objects are added into.

void outcome::ignore (  ) 

Temporarily Ignore the failure of a nested API call.



Role: The integrity of a model is preserved by 'rolling' the failed BULLETIN_BOARD. Nested API failures, however, may be temporarily ignored, until the outermost API block deals with the error.

logical outcome::ok (  )  const [inline]

Returns TRUE if this outcome represents a successful result; otherwise, returns FALSE.

outcome& outcome::operator= ( const outcome o  ) 

Copies state of another outcome into this outcome (assignment operator)

.

Parameters:
o outcome whose data is to be assigned.

void outcome::set_bb ( BULLETIN_BOARD bb  )  [inline]

Sets the bulletin board pointer of this outcome.



Parameters:
bb bulletin board pointer.