| Line | Branch | Decision | Exec | Source |
|---|---|---|---|---|
| 1 | #ifndef EVENT_HPP | |||
| 2 | #define EVENT_HPP | |||
| 3 | ||||
| 4 | #include "types.hpp" | |||
| 5 | #include "det_queue.hpp" | |||
| 6 | ||||
| 7 | class EventDescriptor | |||
| 8 | { | |||
| 9 | // The EventDescriptor object is the microtubule-side interface to the | |||
| 10 | // event queues. It stores information about the upcoming event, and is | |||
| 11 | // used as an entry-point for the event handler when this event is | |||
| 12 | // executed. Every microtubule has three of these objects: one on every tip | |||
| 13 | // and one to keep track of 'ev_disappear' events, when the two tips | |||
| 14 | // annihilate each other. | |||
| 15 | ||||
| 16 | public: | |||
| 17 | ||||
| 18 | // index of this object in the EventDescriptorMap (necessary for removal) | |||
| 19 | EventDescriptorIndex index; | |||
| 20 | Microtubule* const mt; | |||
| 21 | ||||
| 22 | // type of queued event | |||
| 23 | DeterministicEventType type; | |||
| 24 | ||||
| 25 | // associated tracking tag (for validity testing) | |||
| 26 | EventTrackingTag tag; | |||
| 27 | ||||
| 28 | // inverse velocity (with respect to the event clock defined in the queue) | |||
| 29 | double distance_scale_factor; | |||
| 30 | DeterministicQueue* queue; | |||
| 31 | EventDescriptor(Microtubule*, DeterministicQueue*, double); | |||
| 32 | ~EventDescriptor(); | |||
| 33 | ||||
| 34 | // resets the queue and velocity of the event timer | |||
| 35 | void reinitialize(DeterministicQueue*, double); | |||
| 36 | ||||
| 37 | // pushes a deterministic event at a certain distance onto the queue | |||
| 38 | void push_on_queue(double, DeterministicEventType); | |||
| 39 | ||||
| 40 | // invalidates the queued event | |||
| 41 | void clear(); | |||
| 42 | }; | |||
| 43 | ||||
| 44 | class DeterministicEvent | |||
| 45 | { | |||
| 46 | public: | |||
| 47 | ||||
| 48 | double event_time_dist; | |||
| 49 | ||||
| 50 | // -1 indicates a global event | |||
| 51 | EventDescriptorIndex info_idx; | |||
| 52 | ||||
| 53 | union | |||
| 54 | { | |||
| 55 | EventTrackingTag tag; | |||
| 56 | GlobalEventType global_type; | |||
| 57 | }; | |||
| 58 | ||||
| 59 | // define the < operator for automatic sorting of events in the event queue | |||
| 60 | // (nearest first) | |||
| 61 | ✗ | bool operator<(const DeterministicEvent& ev2) const { return event_time_dist > ev2.event_time_dist; } | ||
| 62 | }; | |||
| 63 | ||||
| 64 | #endif // EVENT_HPP | |||
| 65 |