SIMLIB/C++
3.07
|
(SOL-like) facility Facility with exclusive access and service priority More...
#include <simlib.h>
Public Member Functions | |
Facility () | |
Facility (const char *_name) | |
Facility (Queue *_queue1) | |
Facility (const char *_name, Queue *_queue1) | |
virtual | ~Facility () |
virtual void | Output () const override |
print statistics More... | |
operator Facility * () | |
void | SetQueue (Queue *queue1) |
change input queue More... | |
bool | OwnQueue () const |
test for default queue More... | |
bool | Busy () const |
in service More... | |
Entity * | In () const |
current entity or nullptr More... | |
unsigned | QueueLen () const |
virtual void | Seize (Entity *e, ServicePriority_t sp=DEFAULT_PRIORITY) |
virtual void | Release (Entity *e) |
virtual void | QueueIn (Entity *e, ServicePriority_t sp) |
virtual void | Clear () |
initialize More... | |
![]() | |
bool | TestAndSetFlag (bool new_value, unsigned n) |
internal method for flag manipulation is used for algebraic loop checking in continuous blocks More... | |
SimObject () | |
constructor More... | |
virtual | ~SimObject () |
virtual destructor More... | |
void * | operator new (size_t size) |
allocate object, set _flags More... | |
void | operator delete (void *ptr) |
deallocate object More... | |
void * | operator new[] (size_t size)=delete |
void | operator delete[] (void *ptr)=delete |
bool | isAllocated () const |
virtual std::string | Name () const |
get object name More... | |
bool | HasName () const |
void | SetName (const std::string &name) |
assign the name More... | |
Protected Member Functions | |
virtual void | QueueIn2 (Entity *e) |
Protected Attributes | |
Entity * | in |
Entity currently in service. More... | |
Queue * | Q1 |
Input queue. More... | |
Queue * | Q2 |
Interrupted requests queue. More... | |
TStat | tstat |
usage statistics More... | |
![]() | |
unsigned | _flags |
bool flags for internal use (TODO bitfield?) More... | |
Private Attributes | |
unsigned char | _Qflag |
true if facility is owner of input queue More... | |
Additional Inherited Members | |
![]() | |
enum | _Flags { _CLEAR_ALL_FLAGS = 0, _ALLOCATED_FLAG = 1<<0, _EVAL_FLAG = 1<<1, _HAS_NAME_FLAG = 1<<2 } |
(SOL-like) facility Facility with exclusive access and service priority
simlib3::Facility::Facility | ( | ) |
|
explicit |
Definition at line 48 of file facility.cc.
References _OWNQ1, _Qflag, Dprintf, in, Q1, Q2, and simlib3::SimObject::SetName().
|
explicit |
Definition at line 59 of file facility.cc.
References _Qflag, CHECKQUEUE, Dprintf, in, simlib3::SimObject::Name(), Q1, and Q2.
simlib3::Facility::Facility | ( | const char * | _name, |
Queue * | _queue1 | ||
) |
Definition at line 69 of file facility.cc.
References _Qflag, CHECKQUEUE, Dprintf, in, simlib3::SimObject::Name(), Q1, Q2, and simlib3::SimObject::SetName().
|
virtual |
Definition at line 83 of file facility.cc.
References Clear(), Dprintf, simlib3::SimObject::Name(), OwnQueue(), Q1, and Q2.
|
inline |
|
virtual |
initialize
Definition at line 266 of file facility.cc.
References simlib3::TStat::Clear(), simlib3::Queue::Clear(), Dprintf, in, simlib3::SimObject::Name(), OwnQueue(), Q1, Q2, and tstat.
Referenced by ~Facility().
|
inline |
|
overridevirtual |
print statistics
Reimplemented from simlib3::SimObject.
Definition at line 35 of file output2.cc.
References Busy(), simlib3::TStat::MeanValue(), simlib3::SimObject::Name(), simlib3::TStat::Number(), simlib3::Queue::Output(), OwnQueue(), simlib3::Print(), Q1, Q2, simlib3::TStat::StartTime(), simlib3::Queue::StatN, simlib3::Time, and tstat.
bool simlib3::Facility::OwnQueue | ( | ) | const |
test for default queue
Definition at line 282 of file facility.cc.
References _OWNQ1, and _Qflag.
Referenced by Clear(), Output(), simlib3::Store::Output(), SetQueue(), and ~Facility().
|
virtual |
Definition at line 200 of file facility.cc.
References simlib3::Entity::_SPrio, simlib3::Queue::begin(), CHECKENTITY, Dprintf, simlib3::Queue::end(), simlib3::SimObject::Name(), simlib3::Queue::PredIns(), simlib3::Entity::Priority, and Q1.
Referenced by Seize().
|
protectedvirtual |
Definition at line 246 of file facility.cc.
References simlib3::Entity::_SPrio, simlib3::Queue::begin(), Dprintf, simlib3::Queue::end(), simlib3::SimObject::Name(), simlib3::Queue::PredIns(), simlib3::Entity::Priority, and Q2.
Referenced by Seize().
|
inline |
Definition at line 772 of file simlib.h.
References simlib3::SQS::Clear(), simlib3::DEFAULT_PRIORITY, and simlib3::List::size().
Referenced by SetQueue().
|
virtual |
Definition at line 151 of file facility.cc.
References simlib3::Entity::_RemainingTime, simlib3::Entity::_SPrio, simlib3::Entity::Activate(), CHECKENTITY, Dprintf, simlib3::List::empty(), simlib3::flag, simlib3::Queue::front(), simlib3::Queue::GetFirst(), in, simlib3::TStat::n, simlib3::SimObject::Name(), simlib3::Entity::Out(), Q1, Q2, simlib3::ReleaseError, simlib3::ReleaseNotSeized, simlib3::SIMLIB_error(), simlib3::Time, and tstat.
Referenced by simlib3::Process::Release().
|
virtual |
Definition at line 111 of file facility.cc.
References simlib3::Entity::_RemainingTime, simlib3::Entity::_SPrio, simlib3::Entity::ActivationTime(), Busy(), CHECKENTITY, simlib3::Current, Dprintf, simlib3::EntityRefError, simlib3::FacInterruptError, simlib3::Entity::Idle(), in, simlib3::SimObject::Name(), simlib3::Entity::Passivate(), QueueIn(), QueueIn2(), simlib3::SIMLIB_error(), simlib3::Time, and tstat.
Referenced by simlib3::Process::Seize().
void simlib3::Facility::SetQueue | ( | Queue * | queue1 | ) |
change input queue
Definition at line 95 of file facility.cc.
References _OWNQ1, _Qflag, CHECKQUEUE, OwnQueue(), Q1, QueueLen(), simlib3::SetQueueError, and simlib3::SIMLIB_warning().
|
private |
true if facility is owner of input queue
Definition at line 754 of file simlib.h.
Referenced by Facility(), OwnQueue(), and SetQueue().
|
protected |
|
protected |
Input queue.
Definition at line 757 of file simlib.h.
Referenced by Clear(), Facility(), Output(), QueueIn(), Release(), SetQueue(), and ~Facility().
|
protected |
Interrupted requests queue.
Definition at line 758 of file simlib.h.
Referenced by Clear(), Facility(), Output(), QueueIn2(), Release(), and ~Facility().
|
protected |