|
SIMLIB/C++ 3.09
|
(SOL-like) store store capacity can be changed dynamically More...
#include <simlib.h>


Public Member Functions | |
| Store () | |
| Store (unsigned long _capacity) | |
| Store (const char *_name, unsigned long _capacity) | |
| Store (unsigned long _capacity, Queue *queue) | |
| Store (const char *_name, unsigned long _capacity, Queue *queue) | |
| virtual | ~Store () |
| virtual void | Output () const override |
| print statistics | |
| operator Store * () | |
| void | SetCapacity (unsigned long _capacity) |
| change the capacity | |
| void | SetQueue (Queue *queue) |
| change input queue | |
| unsigned long | Free () const |
| free capacity | |
| unsigned long | Used () const |
| used capacity | |
| unsigned long | Capacity () const |
| max capacity | |
| bool | Full () const |
| store is full | |
| bool | Empty () const |
| store is empty | |
| bool | OwnQueue () const |
| OwnQueue. | |
| unsigned | QueueLen () const |
| virtual void | Enter (Entity *e, unsigned long rcap) |
| allocate capacity | |
| virtual void | Leave (unsigned long rcap) |
| deallocate capacity | |
| virtual void | QueueIn (Entity *e, unsigned long c) |
| insert entity into queue | |
| virtual void | Clear () |
| initialize | |
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 | |
Protected Attributes | |
| unsigned long | capacity |
| Capacity of store. | |
| unsigned long | used |
| Currently used capacity. | |
| Queue * | Q |
| input queue | |
| TStat | tstat |
| usage statistics | |
Protected Attributes inherited from simlib3::SimObject | |
| unsigned | _flags |
| bool flags for internal use (TODO bitfield?) | |
Private Attributes | |
| unsigned char | _Qflag |
| true if store is owner of input queue | |
Additional Inherited Members | |
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 } |
|
explicit |
| simlib3::Store::Store | ( | const char * | _name, |
| unsigned long | _capacity | ||
| ) |
Definition at line 56 of file store.cc.
References Dprintf, and simlib3::SimObject::SetName().
| simlib3::Store::Store | ( | unsigned long | _capacity, |
| Queue * | queue | ||
| ) |
Definition at line 66 of file store.cc.
References CHECKQUEUE, Dprintf, and simlib3::SimObject::Name().
| simlib3::Store::Store | ( | const char * | _name, |
| unsigned long | _capacity, | ||
| Queue * | queue | ||
| ) |
Definition at line 76 of file store.cc.
References CHECKQUEUE, Dprintf, simlib3::SimObject::Name(), and simlib3::SimObject::SetName().
|
virtual |
Definition at line 92 of file store.cc.
References Clear(), Dprintf, simlib3::SimObject::Name(), OwnQueue(), and Q.
|
inline |
|
virtual |
initialize
Clear.
Definition at line 191 of file store.cc.
References simlib3::Queue::Clear(), simlib3::TStat::Clear(), Dprintf, simlib3::SimObject::Name(), OwnQueue(), Q, tstat, and used.
Referenced by ~Store().
|
inline |
|
virtual |
allocate capacity
Enter.
Definition at line 128 of file store.cc.
References capacity, simlib3::Current, Dprintf, EnterCapError, EntityRefError, Free(), simlib3::SimObject::Name(), simlib3::Entity::Passivate(), QueueIn(), simlib3::SIMLIB_error(), tstat, and used.
Referenced by simlib3::Process::Enter().
|
inline |
|
inline |
|
virtual |
deallocate capacity
Leave.
Definition at line 152 of file store.cc.
References simlib3::Entity::_RequiredCapacity, simlib3::Entity::Activate(), simlib3::Queue::begin(), Dprintf, simlib3::List::empty(), simlib3::Queue::end(), Free(), Full(), LeaveManyError, simlib3::TStat::n, simlib3::SimObject::Name(), simlib3::Entity::Out(), Q, simlib3::SIMLIB_error(), tstat, and used.
Referenced by simlib3::Process::Leave().
|
overridevirtual |
print statistics
Reimplemented from simlib3::SimObject.
Definition at line 187 of file output2.cc.
References Capacity(), Free(), simlib3::TStat::Max(), simlib3::TStat::MeanValue(), simlib3::TStat::Min(), simlib3::TStat::n, simlib3::SimObject::Name(), simlib3::TStat::Number(), simlib3::Queue::Output(), OwnQueue(), simlib3::Print(), Q, simlib3::TStat::StartTime(), simlib3::Queue::StatN, simlib3::Time, tstat, and used.
| bool simlib3::Store::OwnQueue | ( | ) | const |
|
virtual |
insert entity into queue
QueueIn.
Definition at line 181 of file store.cc.
References simlib3::Entity::_RequiredCapacity, Dprintf, simlib3::Queue::Insert(), simlib3::SimObject::Name(), and Q.
Referenced by Enter().
|
inline |
Definition at line 809 of file simlib.h.
References Q, and simlib3::List::size().
Referenced by SetCapacity(), and SetQueue().
| void simlib3::Store::SetCapacity | ( | unsigned long | newcapacity | ) |
change the capacity
SetCapacity.
Definition at line 102 of file store.cc.
References capacity, QueueLen(), SetCapacityError, simlib3::SIMLIB_error(), and used.
| void simlib3::Store::SetQueue | ( | Queue * | queue | ) |
change input queue
SetQueue.
Definition at line 113 of file store.cc.
References _Qflag, CHECKQUEUE, OwnQueue(), Q, QueueLen(), SetQueueError, and simlib3::SIMLIB_warning().
|
inline |
|
private |
true if store is owner of input queue
Definition at line 786 of file simlib.h.
Referenced by OwnQueue(), and SetQueue().
|
protected |
Capacity of store.
Definition at line 788 of file simlib.h.
Referenced by Capacity(), Enter(), Free(), and SetCapacity().
|
protected |
input queue
Definition at line 790 of file simlib.h.
Referenced by Clear(), Leave(), Output(), QueueIn(), QueueLen(), SetQueue(), and ~Store().
|
protected |
|
protected |