SIMLIB/C++ 3.09
Loading...
Searching...
No Matches
simlib3::Queue Class Reference

priority queue More...

#include <simlib.h>

Inheritance diagram for simlib3::Queue:
Collaboration diagram for simlib3::Queue:

Public Types

typedef List::iterator iterator
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

 Queue ()
 Queue (const char *_name)
 ~Queue ()
virtual void Output () const override
 print statistics
 operator Queue * ()
iterator begin ()
iterator end ()
Entity * front ()
Entity * back ()
void clear ()
 initialize
void Clear ()
bool Empty ()
unsigned Length ()
virtual void Insert (Entity *e)
void InsFirst (Entity *e)
void InsLast (Entity *e)
void PredIns (Entity *e, iterator pos)
void PostIns (Entity *e, iterator pos)
virtual Entity * Get (iterator pos)
 remove at position
Entity * GetFirst ()
Entity * GetLast ()
Public Member Functions inherited from simlib3::List
 List ()
 List (const char *_name)
 ~List ()
void InsFirst (Link *e)
void InsLast (Link *e)
void PredIns (Link *e, iterator pos)
void PostIns (Link *e, iterator pos)
Link * GetFirst ()
 remove first
Link * GetLast ()
 remove last
unsigned size () const
iterator begin ()
iterator end ()
Link * front ()
Link * back ()
bool empty ()
void clear ()
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

Public Attributes

TStat StatN
Stat StatDT

Friends

class Facility
class Store

Additional Inherited Members

Protected Attributes inherited from simlib3::SimObject
unsigned _flags
 bool flags for internal use (TODO bitfield?)

Detailed Description

priority queue

Definition at line 690 of file simlib.h.

Member Typedef Documentation

◆ iterator

Definition at line 695 of file simlib.h.

Constructor & Destructor Documentation

◆ Queue() [1/2]

◆ Queue() [2/2]

simlib3::Queue::Queue ( const char * _name)
explicit

Definition at line 34 of file queue.cc.

References Dprintf, and simlib3::SetName().

◆ ~Queue()

simlib3::Queue::~Queue ( )

Definition at line 43 of file queue.cc.

References Dprintf, and simlib3::SimObject::Name().

Member Function Documentation

◆ back()

Entity * simlib3::Queue::back ( )
inline

Definition at line 707 of file simlib.h.

References simlib3::List::back().

◆ begin()

iterator simlib3::Queue::begin ( )
inline

◆ Clear()

void simlib3::Queue::Clear ( )
inline

Definition at line 711 of file simlib.h.

References clear().

Referenced by simlib3::Facility::Clear(), simlib3::Semaphore::Clear(), and simlib3::Store::Clear().

◆ clear()

void simlib3::Queue::clear ( )

initialize

Definition at line 145 of file queue.cc.

References simlib3::Stat::Clear(), simlib3::TStat::Clear(), simlib3::List::clear(), Dprintf, simlib3::SimObject::Name(), StatDT, and StatN.

Referenced by Clear().

◆ Empty()

bool simlib3::Queue::Empty ( )
inline

Definition at line 712 of file simlib.h.

References simlib3::List::empty().

◆ end()

iterator simlib3::Queue::end ( )
inline

◆ front()

Entity * simlib3::Queue::front ( )
inline

Definition at line 706 of file simlib.h.

References simlib3::List::front().

Referenced by simlib3::Facility::Release(), and simlib3::Semaphore::V().

◆ Get()

Entity * simlib3::Queue::Get ( iterator pos)
virtual

◆ GetFirst()

Entity * simlib3::Queue::GetFirst ( )

Definition at line 113 of file queue.cc.

References begin(), Dprintf, Get(), and simlib3::SimObject::Name().

Referenced by simlib3::Facility::Release().

◆ GetLast()

Entity * simlib3::Queue::GetLast ( )

Definition at line 123 of file queue.cc.

References Dprintf, end(), Get(), and simlib3::SimObject::Name().

◆ Insert()

void simlib3::Queue::Insert ( Entity * e)
virtual

◆ InsFirst()

void simlib3::Queue::InsFirst ( Entity * e)

Definition at line 73 of file queue.cc.

References begin(), Dprintf, simlib3::SimObject::Name(), and PredIns().

◆ InsLast()

void simlib3::Queue::InsLast ( Entity * e)

Definition at line 82 of file queue.cc.

References Dprintf, end(), simlib3::SimObject::Name(), and PredIns().

◆ Length()

unsigned simlib3::Queue::Length ( )
inline

Definition at line 713 of file simlib.h.

References simlib3::List::size().

◆ operator Queue *()

simlib3::Queue::operator Queue * ( )
inline

Definition at line 703 of file simlib.h.

References Queue().

◆ Output()

◆ PostIns()

void simlib3::Queue::PostIns ( Entity * e,
iterator pos )

Definition at line 91 of file queue.cc.

References Dprintf, end(), simlib3::SimObject::Name(), PredIns(), and SIMLIB_internal_error.

◆ PredIns()

◆ Facility

friend class Facility
friend

Definition at line 692 of file simlib.h.

References Facility.

Referenced by Facility.

◆ Store

friend class Store
friend

Definition at line 693 of file simlib.h.

References Store.

Referenced by Store.

Member Data Documentation

◆ StatDT

Stat simlib3::Queue::StatDT

Definition at line 697 of file simlib.h.

Referenced by clear(), Get(), and Output().

◆ StatN

TStat simlib3::Queue::StatN

Definition at line 696 of file simlib.h.

Referenced by clear(), Get(), simlib3::Facility::Output(), Output(), simlib3::Store::Output(), and PredIns().


The documentation for this class was generated from the following files: