runtime_history Class Reference

Keeps a record of the outcomes that have been recorded by objects. More...

#include <runtime_history.h>

Inheritance diagram for runtime_history:

Inheritance graph
[legend]
Collaboration diagram for runtime_history:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 runtime_history (int maximum_length=DEFAULT_RUNTIME_HISTORY)
 ~runtime_history ()
void add_outcome (const occurrence &happening)
 adds the occurrence in "happening" to the runtime history.
int elements () const
 returns the number of occurrences that are in our list.
const occurrenceget (int index)
 returns the occurrences that resides at index in the list.
void lock ()
 fixate the list for scanning. must unlock when done.
void unlock ()
 allow others to use the list again.
virtual void pack (byte_array &packed_form) const
 supports streaming the history out.
virtual bool unpack (byte_array &packed_form)
 supports streaming the history in.
int max_items () const
 observes the maximum number of occurrences this object holds.
void set_max_items (int new_max)
 modifies the maximum number of occurrences that we'll hold.

Detailed Description

Keeps a record of the outcomes that have been recorded by objects.

An occurrence being recorded here is generally a sign that the outcomes seem were suspicious, problematic, unusual, extraordinary, or horrendously bad. The history list is allowed to hold a certain number of entries before the more ancient entries begin dropping out of the list.

Note: this class is thread-safe and can be used globally within a program.

Definition at line 39 of file runtime_history.h.


Constructor & Destructor Documentation

runtime_history::runtime_history ( int  maximum_length = DEFAULT_RUNTIME_HISTORY  ) 

Definition at line 36 of file runtime_history.cpp.

References DEFAULT_RUNTIME_HISTORY.

runtime_history::~runtime_history (  ) 

Definition at line 44 of file runtime_history.cpp.

References WHACK().


Member Function Documentation

void runtime_history::add_outcome ( const occurrence happening  ) 

adds the occurrence in "happening" to the runtime history.

if the list would exceed its maximum, then an entry is chopped.

Definition at line 72 of file runtime_history.cpp.

References AUTO_LOCK, and occurrence::valid().

int runtime_history::elements (  )  const

returns the number of occurrences that are in our list.

Definition at line 63 of file runtime_history.cpp.

References AUTO_LOCK.

const occurrence & runtime_history::get ( int  index  ) 

returns the occurrences that resides at index in the list.

Definition at line 84 of file runtime_history.cpp.

References AUTO_LOCK, and bounds_return.

void runtime_history::lock (  ) 

fixate the list for scanning. must unlock when done.

Definition at line 50 of file runtime_history.cpp.

References mutex_base::lock().

void runtime_history::unlock (  ) 

allow others to use the list again.

Definition at line 52 of file runtime_history.cpp.

References mutex_base::unlock().

void runtime_history::pack ( byte_array packed_form  )  const [virtual]

supports streaming the history out.

Implements packable.

Definition at line 66 of file runtime_history.cpp.

References AUTO_LOCK, and basis::pack().

bool runtime_history::unpack ( byte_array packed_form  )  [virtual]

supports streaming the history in.

Implements packable.

Definition at line 69 of file runtime_history.cpp.

References AUTO_LOCK, and basis::unpack().

int runtime_history::max_items (  )  const

observes the maximum number of occurrences this object holds.

Definition at line 54 of file runtime_history.cpp.

References AUTO_LOCK.

void runtime_history::set_max_items ( int  new_max  ) 

modifies the maximum number of occurrences that we'll hold.

Definition at line 56 of file runtime_history.cpp.

References AUTO_LOCK, and DEFAULT_RUNTIME_HISTORY.


The documentation for this class was generated from the following files:
Generated on Fri Sep 5 04:30:49 2008 for HOOPLE Libraries by  doxygen 1.5.1