#include <runtime_history.h>
Inheritance diagram for runtime_history:


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 occurrence & | get (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. | |
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.
| runtime_history::runtime_history | ( | int | maximum_length = DEFAULT_RUNTIME_HISTORY |
) |
| runtime_history::~runtime_history | ( | ) |
| 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.
1.5.1