- A Logic Circuit Simulation Library in C++ |
#include <clock.h>
Inheritance diagram for lcs::Clock:
Clock
object. The returned Clock
object is instantiated by a shallow copy-constructor.
The pulse width of the clock can be altered using the lcs::Clock::setPulseWidth
function. The pulse width is measured in system time units. By default, the pulse width is set to 100 system time units.
See lcs::SystemTimer
for more information.
Public Member Functions | |
Clock (const Clock &clk) | |
~Clock () | |
virtual void | tick () |
void | notifyTick (TickListener *tl) |
void | stopTickNotification (TickListener *tl) |
Static Public Member Functions | |
static Clock | getClock (void) throw (NullClockException) |
static void | setPulseWidth (unsigned int width) |
lcs::Clock::Clock | ( | const Clock & | clk | ) |
Copy constructor.
lcs::Clock::~Clock | ( | ) |
Destructor.
static Clock lcs::Clock::getClock | ( | void | ) | throw (NullClockException) [static] |
Returns a clock object. The returned object is a shallow copy of the single Clock
object which can exist.
void lcs::Clock::notifyTick | ( | TickListener * | tl | ) |
This function can used by a lcs::TickListener
derivative to get notified of a clock state change.
static void lcs::Clock::setPulseWidth | ( | unsigned int | width | ) | [static] |
Sets the pulse width of the clock in system time units.
width | The desired pulse width in system time units. |
void lcs::Clock::stopTickNotification | ( | TickListener * | tl | ) |
A lcs::TickListener
derivative which registered to be notified of a clock state change should de-register using this function when notification is no longer required. This function SHOULD be called just before the object ceases to exist in the simulation system. Else, a segmentation fault is bound to occur.
virtual void lcs::Clock::tick | ( | ) | [virtual] |
This function is used by lcs::SystemTimer
to notify the clock of the system time. This function will never need to be used by a user of libLCS.