|
SIMLIB/C++ 3.09
|
abstract base class for active entities (Process, Event) instances of derived classes provide Behavior() method implementation, execution can be scheduled in calendar More...
#include <simlib.h>


Public Types | |
| typedef EntityPriority_t | Priority_t |
| Public Types inherited from simlib3::SimObject | |
| enum | _Flags { _CLEAR_ALL_FLAGS = 0 , _ALLOCATED_FLAG = 1<<0 , _EVAL_FLAG = 1<<1 , _HAS_NAME_FLAG = 1<<2 } |
Public Member Functions | |
| unsigned long | id () const |
| Entity (Priority_t p=DEFAULT_PRIORITY) | |
| constructor | |
| virtual | ~Entity () |
| destructor | |
| operator Entity * () | |
| double | ActivationTime () |
| get activation time of entity - iff scheduled it is here, because Entity has no knowledge of calendar activation record structure | |
| void | Activate () |
| activate now | |
| virtual void | Activate (double t) |
| activate at time t (schedule) | |
| virtual void | Passivate () |
| deactivation | |
| virtual void | Terminate ()=0 |
| end Behavior() and remove entity | |
| bool | Idle () |
| entity activation is not scheduled in calendar | |
| void | Cancel () |
| end Behavior() and remove entity | |
| virtual void | Out () override |
| remove entity from queue | |
| EventNotice * | GetEventNotice () |
| Public Member Functions inherited from simlib3::Link | |
| Link () | |
| virtual | ~Link () |
| virtual void | Into (List *l) |
| insert last | |
| List * | Where () |
| where is linked | |
| virtual bool | isInQueue () |
| present in queue | |
| Public Member Functions inherited from simlib3::SimObject | |
| bool | TestAndSetFlag (bool new_value, unsigned n) |
| internal method for flag manipulation is used for algebraic loop checking in continuous blocks | |
| SimObject () | |
| constructor | |
| virtual | ~SimObject () |
| virtual destructor | |
| void * | operator new (size_t size) |
| allocate object, set _flags | |
| void | operator delete (void *ptr) |
| deallocate object | |
| void * | operator new[] (size_t size)=delete |
| void | operator delete[] (void *ptr)=delete |
| bool | isAllocated () const |
| virtual std::string | Name () const |
| get object name | |
| bool | HasName () const |
| void | SetName (const std::string &name) |
| assign the name | |
| virtual void | Output () const |
| print object to default output | |
Public Attributes | |
| Priority_t | Priority |
| priority of the entity (scheduling,queues) | |
Protected Attributes | |
| unsigned long | _Ident |
| unique identification number of entity | |
| double | _MarkTime |
| union simlib3::Entity:: { ... } | |
| ServicePriority_t | _SPrio |
| priority of service in Facility | |
| Protected Attributes inherited from simlib3::SimObject | |
| unsigned | _flags |
| bool flags for internal use (TODO bitfield?) | |
Static Protected Attributes | |
| static unsigned long | _Number = 0L |
| current number of entities | |
Private Member Functions | |
| virtual void | _Run () noexcept=0 |
| run the Behavior() function | |
Private Attributes | |
| EventNotice * | _evn |
| points to calendar item, iff scheduled | |
Friends | |
| class | Queue |
| class | Facility |
| class | Store |
| struct | EventNotice |
| void | SIMLIB_DoActions () |
Additional Inherited Members | |
| Protected Member Functions inherited from simlib3::Link | |
| Link (Link *p, Link *s, List *h) | |
abstract base class for active entities (Process, Event) instances of derived classes provide Behavior() method implementation, execution can be scheduled in calendar
| simlib3::Entity::Entity | ( | Priority_t | p = DEFAULT_PRIORITY | ) |
constructor
Definition at line 33 of file entity.cc.
References _evn, _Ident, _MarkTime, _Number, _SPrio, Dprintf, Priority, and simlib3::SIMLIB_Entity_Count.
Referenced by simlib3::Event::Event(), operator Entity *(), and simlib3::Process::Process().
|
virtual |
|
privatepure virtualnoexcept |
run the Behavior() function
Implemented in simlib3::Event, and simlib3::Process.
References SIMLIB_DoActions.
Referenced by SIMLIB_DoActions.
|
inline |
activate now
Definition at line 413 of file simlib.h.
References Activate(), and simlib3::Time.
Referenced by simlib3::Activate(), Activate(), simlib3::Event::Activate(), simlib3::Process::Activate(), simlib3::Event::Behavior(), simlib3::Process::Behavior(), simlib3::Barrier::Break(), simlib3::Barrier::Enter(), simlib3::Process::Interrupt(), simlib3::Store::Leave(), simlib3::Facility::Release(), simlib3::Semaphore::V(), simlib3::Barrier::Wait(), and simlib3::Process::Wait().
|
virtual |
activate at time t (schedule)
entity activation at given time
Reimplemented in simlib3::Event, and simlib3::Process.
Definition at line 56 of file entity.cc.
References simlib3::SQS::Get(), Idle(), simlib3::SQS::ScheduleAt(), and t.
| double simlib3::Entity::ActivationTime | ( | ) |
get activation time of entity - iff scheduled
it is here, because Entity has no knowledge of calendar activation record structure
Definition at line 1358 of file calendar.cc.
References GetEventNotice(), Idle(), simlib3::SIMLIB_MAXTIME, and simlib3::EventNotice::time.
Referenced by simlib3::CalendarQueue::Get(), and simlib3::Facility::Seize().
|
inline |
|
inline |
Definition at line 432 of file simlib.h.
References _evn, EventNotice, and GetEventNotice().
Referenced by ActivationTime(), simlib3::EventNotice::Create(), GetEventNotice(), and simlib3::CalendarListImplementation::remove().
|
inline |
Definition at line 401 of file simlib.h.
References _Ident.
Referenced by simlib3::WaitUntilList::GetCurrent(), simlib3::WaitUntilList::InsertCurrent(), and simlib3::WaitUntilList::Remove().
|
inline |
entity activation is not scheduled in calendar
Definition at line 417 of file simlib.h.
References _evn.
Referenced by simlib3::Event::_Run(), simlib3::Process::_Run(), Activate(), ActivationTime(), simlib3::CalendarList::Get(), simlib3::CalendarQueue::Get(), Passivate(), simlib3::SQS::ScheduleAt(), simlib3::Facility::Seize(), Terminate(), simlib3::Event::Terminate(), simlib3::Process::Terminate(), ~Entity(), and simlib3::Process::~Process().
|
inline |
|
overridevirtual |
remove entity from queue
Reimplemented from simlib3::Link.
Definition at line 90 of file entity.cc.
References simlib3::Link::Out().
Referenced by simlib3::Process::_Run(), simlib3::Process::Into(), simlib3::Store::Leave(), simlib3::Facility::Release(), simlib3::Process::Terminate(), and simlib3::Process::~Process().
|
virtual |
deactivation
Reimplemented in simlib3::Process.
Definition at line 68 of file entity.cc.
References simlib3::SQS::Get(), and Idle().
Referenced by simlib3::Sampler::Behavior(), simlib3::Barrier::Enter(), simlib3::Store::Enter(), simlib3::Passivate(), simlib3::Process::Passivate(), simlib3::Facility::Seize(), simlib3::Sampler::Stop(), simlib3::ZDelayTimer::Stop(), and simlib3::Barrier::Wait().
|
pure virtual |
end Behavior() and remove entity
passivate and destroy entity
Implemented in simlib3::Event, and simlib3::Process.
Definition at line 97 of file entity.cc.
References Dprintf, simlib3::SQS::Get(), Idle(), simlib3::SimObject::isAllocated(), simlib3::SimObject::Name(), and simlib3::SIMLIB_Current.
Referenced by Cancel().
|
friend |
Definition at line 429 of file simlib.h.
References EventNotice.
Referenced by EventNotice, and GetEventNotice().
|
friend |
Definition at line 391 of file simlib.h.
References Facility.
Referenced by simlib3::Process::Behavior(), Facility, simlib3::Process::Release(), and simlib3::Process::Seize().
|
friend |
Definition at line 388 of file simlib.h.
References Queue.
Referenced by simlib3::Process::Behavior(), simlib3::Process::Into(), and Queue.
|
friend |
Definition at line 135 of file run.cc.
References _Run(), CALL_HOOK, simlib3::SIMLIB_Current, and SIMLIB_DoActions.
Referenced by _Run(), and SIMLIB_DoActions.
|
friend |
Definition at line 392 of file simlib.h.
References Store.
Referenced by simlib3::Process::Behavior(), simlib3::Process::Enter(), simlib3::Process::Leave(), and Store.
| union { ... } simlib3::Entity |
|
private |
points to calendar item, iff scheduled
Definition at line 430 of file simlib.h.
Referenced by simlib3::EventNotice::create_reverse_link(), simlib3::EventNotice::delete_reverse_link(), Entity(), GetEventNotice(), and Idle().
|
protected |
unique identification number of entity
Definition at line 383 of file simlib.h.
Referenced by simlib3::Process::_Run(), simlib3::Event::Activate(), simlib3::Process::Activate(), Entity(), id(), simlib3::Process::Interrupt(), simlib3::Event::Name(), simlib3::Process::Name(), simlib3::Process::Terminate(), simlib3::Process::Wait(), and ~Entity().
|
protected |
Definition at line 389 of file simlib.h.
Referenced by Entity(), simlib3::Queue::Get(), and simlib3::Queue::PredIns().
|
staticprotected |
|
protected |
priority of service in Facility
Definition at line 398 of file simlib.h.
Referenced by Entity(), simlib3::Facility::QueueIn(), simlib3::Facility::QueueIn2(), simlib3::Facility::Release(), and simlib3::Facility::Seize().
| Priority_t simlib3::Entity::Priority |
priority of the entity (scheduling,queues)
priority of the entity
Definition at line 404 of file simlib.h.
Referenced by simlib3::EventNotice::Create(), Entity(), simlib3::Queue::Insert(), simlib3::WaitUntilList::InsertCurrent(), simlib3::Facility::QueueIn(), simlib3::Facility::QueueIn2(), and simlib3::EventNotice::Set().