1 #ifndef __EVENT_CALENDAR_EVENT_CALENDAR_H__
2 #define __EVENT_CALENDAR_EVENT_CALENDAR_H__
6 #include "../Constants/Constants.h"
50 CalendarNode* CircleAL;
51 CalendarNode* CircleAR;
52 CalendarNode* CircleBL;
53 CalendarNode* CircleBR;
64 CalendarNode(
const CalendarNode& other);
67 void Insert(CalendarNode* ins);
82 CalendarNode* Delete();
88 std::pair<unsigned long, unsigned long> MinMax()
const;
91 std::vector<CalendarNode> ListAnchor;
93 CalendarNode* FreeList;
98 double CurrentEventTime;
99 int CurrentEventObjectA;
100 int CurrentEventObjectB;
104 CalendarNode* AllocateNode();
112 void FreeNode(CalendarNode* node);
121 CalendarNode* SafeDelete(CalendarNode* node);
128 bool NodeInTree(CalendarNode
const *
const node);
int GetCurrentObjectB() const
Definition: EventCalendar.cpp:548
void NextEvent()
Advance the calendar one step and put the next event into the current event place holders...
Definition: EventCalendar.cpp:418
Definition: EventCalendar.h:35
EventType
Enumeration of the various event types in the system.
Definition: EventType.h:28
EventType GetCurrentEventType() const
Definition: EventCalendar.cpp:555
double BalanceRatio() const
Computes the ratio of the longest path to a leaf over the shortest path to a leaf.
Definition: EventCalendar.cpp:562
double GetCurrentTime() const
Definition: EventCalendar.cpp:534
bool HasMoreEvents()
Test whether the calendar has more events in it.
Definition: EventCalendar.cpp:528
const int NULL_PARTICLE
A particle index representing an invalid particle.
Definition: Constants.h:41
void ClearCalendar()
Empties all events from the event calendar and returns the allocated tree nodes to the free list...
Definition: EventCalendar.cpp:271
EventCalendar(const unsigned particleCount)
Initialize the calendar for a given number of particles.
Definition: EventCalendar.cpp:211
int GetCurrentObjectA() const
Definition: EventCalendar.cpp:541
~EventCalendar()
Clean up the dynamically allocated memory.
Definition: EventCalendar.cpp:254
void ScheduleEvent(const double time, const EventType type, const int idA=Constants::NULL_PARTICLE, const int idB=Constants::NULL_PARTICLE)
Schedule an event with the calendar.
Definition: EventCalendar.cpp:354