This library is a collection of finite automata that have useful properties. Objects that are similar to automata or machines are also included. The ithread and state_machine classes are particularly useful. Note that the software is distributed under the GNU Public License. No warranty is made for it whatsoever. We have done our best to ensure that this software is high quality and error-free, but cannot guarantee anything real about it due to potential legal culpability. If you find bugs in this software or wish to contribute enhancements to it, please send them to the HOOPLE Administrator. |
heartbeat class [h, cpp]Tracks the liveness of an object. The object gets a certain number of misses when it is requested to respond with a heartbeat thump. Each request for a thump occurs at a specified regular interval. When the object has not responded within the "miss limit" number of times where each miss was allowed the interval number of milliseconds, then the object is considered dead. A thump at any time before total death will bring the object back to a state of zero misses. hysteresis class [h, cpp]Attempts to respond to a changing data value with hysteresis, that is, the current value is allowed to vary within a certain range for a certain time period past the upper or lower limit before effort is put into moving the value back. This is totally just an idea at this point... ini_roller class [h, cpp]An object derived from the roller class which stores its current state in a configurator (see Data Structures Library). ithread class [h, cpp]Encapsulates the thread primitives for Linux and Win32 into an easy to use thread object. One virtual function must be provided; this is called once for a one shot thread or repeatedly for a periodic thread. roller template [h, cpp]Issues an identifier of the templated type. The issued id will roam between the lower and upper bounds specified. Useful for issuing semi-unique ids. reader_writer_lock class [h, cpp]Controls access to a shared resource within a program. The resource can be either read or written to. Any number of simultaneous readers is allowed, but only one writer is allowed to access the resource while readers are locked out. There is no provision for avoiding starvation for the writer or readers. safe_roller class [h, cpp]Synchronizes a roller object for multi-threaded access. The current value is protected from corruption. semaphore class [h, cpp]Implements the classic operating system primitive for concurrency control. This mimics a resource's availability if there are N identical copies of the resource. The semaphore will allow itself to be locked N times. Unlocking the semaphore reduces the count. If the count would go above N, then the semaphore blocks the locking thread until some other thread unlocks the semaphore. This then allows the first queued thread to continue and be granted one of the resources. Note that any specific resources being administrated are supplied elsewhere; the semaphore just tracks the counter value. state_machine class [h, cpp]Provides an object for the commonly used pattern of a state machine. The state machine has a number of states and a list of transitions between states. The transition list is embodied in a transition_map, which describes all legal state changes and their causes. The transition causes supported here are: manual, timed & data-forced. Manual transitions can occur because of external logic decisions; they must be listed in the transition map, but that is the only requirement on them. Timed transitions occur when a state machine has stayed in the same state for a specified time period. Data-forced transitions occur when a known trigger value is presented to a state; this input data forces it along a listed transition to a different state. thread_cabinet class [h, cpp]This is somewhat of a locker for threads. An ithread object can be stored in a thread cabinet once it's created. The cabinet will then take possession of that thread. When the thread_cabinet is destroyed, any threads held in it will be stopped and then destroyed. throughput_counter class [h, cpp]Calculates the bandwidth seen on a particular network connection. time_stamp class [h, cpp]Provides a fairly accurate means for comparing times using the operating system's uptime value. The time_stamp has a resolution of milliseconds. timer class [h, cpp]Acts like a stopwatch and can measure elapsed time. The timer can be paused during times that the timed activity is not occurring and then restarted to measure a cumulative time. |