SIMLIB/C++
3.07
|
common interface for all calendar (PES) implementations More...
Public Member Functions | |
bool | Empty () const |
unsigned | Size () const |
virtual void | ScheduleAt (Entity *e, double t)=0 |
enqueue More... | |
virtual Entity * | GetFirst ()=0 |
dequeue first More... | |
virtual Entity * | Get (Entity *e)=0 |
dequeue More... | |
virtual void | clear (bool destroy_entities=false)=0 |
remove all scheduled entities More... | |
virtual const char * | Name ()=0 |
virtual void | debug_print ()=0 |
for debugging only More... | |
double | MinTime () const |
time of activation of first item More... | |
Static Public Member Functions | |
static Calendar * | instance () |
create/get single instance (singleton) More... | |
static bool | instance_exists () |
check if the instance exists More... | |
Protected Member Functions | |
void | SetMinTime (double t) |
set cache for faster access More... | |
Calendar () | |
virtual | ~Calendar () |
clear is called in derived class dtr More... | |
Static Protected Member Functions | |
static void | delete_instance () |
destroy single instance More... | |
Protected Attributes | |
unsigned | _size |
number of scheduled items More... | |
Private Attributes | |
double | mintime |
activation time of first event More... | |
Static Private Attributes | |
static Calendar * | _instance = 0 |
pointer to single instance More... | |
Friends | |
void | SetCalendar (const char *name) |
choose calendar implementation default is list More... | |
common interface for all calendar (PES) implementations
Definition at line 67 of file calendar.cc.
|
inlineprotected |
Definition at line 105 of file calendar.cc.
|
inlineprotectedvirtual |
clear is called in derived class dtr
Definition at line 106 of file calendar.cc.
References delete_instance().
|
pure virtual |
remove all scheduled entities
Implemented in simlib3::CalendarQueue, and simlib3::CalendarList.
Referenced by simlib3::SQS::Clear(), Size(), simlib3::CalendarQueue::time2bucket_top(), simlib3::CalendarListImplementation::~ CalendarListImplementation(), simlib3::CalendarList::~CalendarList(), and simlib3::EventNoticeAllocator::~EventNoticeAllocator().
|
pure virtual |
for debugging only
Implemented in simlib3::CalendarQueue, and simlib3::CalendarList.
Referenced by simlib3::SQS::debug_print(), simlib3::CalendarQueue::Name(), Size(), simlib3::CalendarListImplementation::~ CalendarListImplementation(), and simlib3::CalendarList::~CalendarList().
|
staticprotected |
destroy single instance
Definition at line 1216 of file calendar.cc.
References _instance, simlib3::CalendarQueue::create(), Dprintf, and simlib3::SIMLIB_error().
Referenced by simlib3::CalendarList::create(), simlib3::CalendarQueue::create(), simlib3::SetCalendar(), and ~Calendar().
|
inline |
Definition at line 69 of file calendar.cc.
References _size.
Referenced by simlib3::CalendarQueue::clear(), simlib3::SQS::Empty(), simlib3::CalendarList::Get(), simlib3::CalendarQueue::Get(), simlib3::CalendarList::GetFirst(), simlib3::CalendarQueue::GetFirst(), simlib3::CalendarQueue::SearchMinTime(), and simlib3::CalendarQueue::visualize().
dequeue
Implemented in simlib3::CalendarQueue, and simlib3::CalendarList.
Referenced by simlib3::SQS::Get(), Size(), and simlib3::CalendarQueue::time2bucket_top().
|
pure virtual |
dequeue first
Implemented in simlib3::CalendarQueue, and simlib3::CalendarList.
Referenced by simlib3::SQS::GetFirst(), Size(), and simlib3::CalendarQueue::time2bucket_top().
|
inlinestatic |
create/get single instance (singleton)
interface to singleton instance
Definition at line 1204 of file calendar.cc.
References _instance, simlib3::CalendarList::create(), and simlib3::CalendarQueue::create().
Referenced by simlib3::SQS::Clear(), simlib3::SQS::debug_print(), simlib3::SQS::Empty(), simlib3::SQS::Get(), simlib3::SQS::GetFirst(), and simlib3::SQS::ScheduleAt().
|
inlinestatic |
check if the instance exists
Definition at line 101 of file calendar.cc.
References _instance.
Referenced by simlib3::CalendarList::debug_print(), and simlib3::CalendarQueue::debug_print().
|
inline |
time of activation of first item
Definition at line 85 of file calendar.cc.
References mintime.
Referenced by simlib3::SQS::Clear(), simlib3::CalendarQueue::estimate_bucket_width(), simlib3::SQS::Get(), simlib3::CalendarQueue::Get(), simlib3::SQS::GetFirst(), simlib3::CalendarQueue::GetFirst(), simlib3::SQS::ScheduleAt(), simlib3::CalendarList::ScheduleAt(), simlib3::CalendarQueue::ScheduleAt(), simlib3::CalendarQueue::switchtocq(), and simlib3::CalendarQueue::visualize().
|
pure virtual |
Implemented in simlib3::CalendarQueue, and simlib3::CalendarList.
Referenced by Size().
|
pure virtual |
enqueue
Implemented in simlib3::CalendarQueue, and simlib3::CalendarList.
Referenced by simlib3::SQS::ScheduleAt(), Size(), and simlib3::CalendarQueue::time2bucket_top().
|
inlineprotected |
set cache for faster access
Definition at line 88 of file calendar.cc.
Referenced by simlib3::CalendarList::CalendarList(), simlib3::CalendarQueue::CalendarQueue(), simlib3::CalendarList::clear(), simlib3::CalendarQueue::clear(), simlib3::CalendarList::Get(), simlib3::CalendarQueue::Get(), simlib3::CalendarList::GetFirst(), simlib3::CalendarQueue::GetFirst(), simlib3::CalendarList::ScheduleAt(), simlib3::CalendarQueue::ScheduleAt(), and simlib3::CalendarQueue::SearchMinTime().
|
inline |
Definition at line 70 of file calendar.cc.
References _size, clear(), debug_print(), Get(), GetFirst(), Name(), ScheduleAt(), and t.
Referenced by simlib3::SQS::debug_print(), simlib3::SQS::Get(), simlib3::SQS::GetFirst(), simlib3::SQS::ScheduleAt(), and simlib3::CalendarQueue::visualize().
|
friend |
choose calendar implementation default is list
Set calendar implementation.
name | String identification of calendar: "list", "cq" |
Definition at line 1250 of file calendar.cc.
|
staticprivate |
pointer to single instance
static pointer to singleton instance
Definition at line 109 of file calendar.cc.
Referenced by delete_instance(), instance(), instance_exists(), and simlib3::CalendarQueue::visualize().
|
protected |
number of scheduled items
Definition at line 93 of file calendar.cc.
Referenced by simlib3::CalendarList::clear(), simlib3::CalendarQueue::clear(), Empty(), simlib3::CalendarList::Get(), simlib3::CalendarQueue::Get(), simlib3::CalendarList::GetFirst(), simlib3::CalendarQueue::GetFirst(), simlib3::CalendarQueue::Resize(), simlib3::CalendarList::ScheduleAt(), simlib3::CalendarQueue::ScheduleAt(), Size(), and simlib3::CalendarQueue::switchtocq().
|
private |
activation time of first event
Definition at line 95 of file calendar.cc.
Referenced by MinTime(), and SetMinTime().