SIMLIB/C++
3.07
|
Base class for almost all SIMLIB classes. More...
#include <simlib.h>
Public Types | |
enum | _Flags { _CLEAR_ALL_FLAGS = 0, _ALLOCATED_FLAG = 1<<0, _EVAL_FLAG = 1<<1, _HAS_NAME_FLAG = 1<<2 } |
Public Member Functions | |
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... | |
virtual void | Output () const |
print object to default output More... | |
Protected Attributes | |
unsigned | _flags |
bool flags for internal use (TODO bitfield?) More... | |
Private Member Functions | |
SimObject (const SimObject &)=delete | |
disable copy operation More... | |
SimObject & | operator= (const SimObject &)=delete |
disable assign operation More... | |
Base class for almost all SIMLIB classes.
simlib3::SimObject::SimObject | ( | ) |
constructor
Definition at line 100 of file object.cc.
References _ALLOCATED_FLAG, and _flags.
Referenced by HasName().
|
virtual |
virtual destructor
Definition at line 114 of file object.cc.
References simlib3::NameDict::Erase(), and HasName().
|
privatedelete |
disable copy operation
|
inline |
Definition at line 321 of file simlib.h.
References _HAS_NAME_FLAG, operator=(), Output(), SetName(), and SimObject().
Referenced by simlib3::Hyst::Eval(), simlib3::Blash::Eval(), simlib3::Relay::Eval(), simlib3::AlgLoop::Set(), simlib3::SIMLIB_DoConditions(), simlib3::_Add::Value(), simlib3::_Sub::Value(), simlib3::_Mul::Value(), simlib3::_Div::Value(), simlib3::_UMinus::Value(), simlib3::Integrator::Value(), simlib3::Status::Value(), simlib3::Function1::Value(), simlib3::Function2::Value(), simlib3::Lim::Value(), simlib3::Insv::Value(), simlib3::Qntzr::Value(), simlib3::Frict::Value(), simlib3::Rline::Value(), and ~SimObject().
|
inline |
Definition at line 318 of file simlib.h.
References _ALLOCATED_FLAG, and Name().
Referenced by simlib3::Process::_Run(), simlib3::WaitUntilList::clear(), simlib3::CalendarListImplementation::clear(), simlib3::List::clear(), operator delete(), simlib3::Entity::Terminate(), simlib3::Process::Terminate(), and simlib3::Event::Terminate().
|
virtual |
get object name
get the name of object
Reimplemented in simlib3::Event, simlib3::Process, and simlib3::_Time.
Definition at line 134 of file object.cc.
References simlib3::NameDict::Get().
Referenced by simlib3::Barrier::ChangeHeight(), simlib3::TStat::Clear(), simlib3::Queue::clear(), simlib3::Facility::Clear(), simlib3::Store::Clear(), simlib3::Semaphore::Clear(), simlib3::Barrier::Clear(), simlib3::Store::Enter(), simlib3::Barrier::Enter(), simlib3::Hyst::Eval(), simlib3::Blash::Eval(), simlib3::Relay::Eval(), simlib3::Facility::Facility(), simlib3::Queue::Get(), simlib3::Queue::GetFirst(), simlib3::Queue::GetLast(), simlib3::GetName(), simlib3::Barrier::Init(), simlib3::Queue::Insert(), simlib3::Queue::InsFirst(), simlib3::Queue::InsLast(), isAllocated(), simlib3::Store::Leave(), simlib3::Process::Name(), simlib3::Event::Name(), Output(), simlib3::Process::Output(), simlib3::Stat::Output(), simlib3::TStat::Output(), simlib3::Queue::Output(), simlib3::Histogram::Output(), simlib3::Facility::Output(), simlib3::Store::Output(), simlib3::Semaphore::Output(), simlib3::Barrier::Output(), simlib3::Semaphore::P(), simlib3::Queue::PostIns(), simlib3::Queue::PredIns(), simlib3::Facility::QueueIn(), simlib3::Store::QueueIn(), simlib3::Facility::QueueIn2(), simlib3::Facility::Release(), simlib3::CalendarQueue::ScheduleAt(), simlib3::Facility::Seize(), simlib3::AlgLoop::Set(), simlib3::SIMLIB_DoConditions(), simlib3::Store::Store(), simlib3::Entity::Terminate(), simlib3::Semaphore::V(), simlib3::_Add::Value(), simlib3::_Sub::Value(), simlib3::_Mul::Value(), simlib3::_Div::Value(), simlib3::_UMinus::Value(), simlib3::Integrator::Value(), simlib3::Status::Value(), simlib3::Function1::Value(), simlib3::Function2::Value(), simlib3::Lim::Value(), simlib3::Insv::Value(), simlib3::Qntzr::Value(), simlib3::Frict::Value(), simlib3::Rline::Value(), simlib3::Barrier::Wait(), simlib3::Barrier::~Barrier(), simlib3::Facility::~Facility(), simlib3::Histogram::~Histogram(), simlib3::List::~List(), simlib3::Queue::~Queue(), simlib3::Semaphore::~Semaphore(), simlib3::Stat::~Stat(), simlib3::Store::~Store(), and simlib3::TStat::~TStat().
void simlib3::SimObject::operator delete | ( | void * | ptr | ) |
deallocate object
free memory
Definition at line 87 of file object.cc.
References _flags, and isAllocated().
|
delete |
void * simlib3::SimObject::operator new | ( | size_t | size | ) |
|
delete |
disable assign operation
Referenced by HasName().
|
virtual |
print object to default output
print object's info TODO: use operator <<
Reimplemented in simlib3::Barrier, simlib3::Semaphore, simlib3::Store, simlib3::Facility, simlib3::Histogram, simlib3::Queue, simlib3::List, simlib3::TStat, simlib3::Stat, simlib3::Sampler, simlib3::Event, and simlib3::Process.
Definition at line 144 of file object.cc.
References Name(), and simlib3::Print().
Referenced by simlib3::Sampler::GetStep(), HasName(), and simlib3::Barrier::Height().
void simlib3::SimObject::SetName | ( | const std::string & | name | ) |
assign the name
set the name of object
Definition at line 125 of file object.cc.
References _flags, _HAS_NAME_FLAG, and simlib3::NameDict::Set().
Referenced by simlib3::Barrier::Barrier(), simlib3::Facility::Facility(), HasName(), simlib3::Histogram::Histogram(), simlib3::List::List(), simlib3::Newton::Newton(), simlib3::Queue::Queue(), simlib3::RemoveName(), simlib3::Semaphore::Semaphore(), simlib3::SetName(), simlib3::Stat::Stat(), simlib3::Store::Store(), and simlib3::TStat::TStat().
|
inline |
internal method for flag manipulation is used for algebraic loop checking in continuous blocks
Definition at line 293 of file internal.h.
Referenced by simlib3::AlgLoopDetector::lock(), and simlib3::AlgLoopDetector::unlock().
|
protected |
bool flags for internal use (TODO bitfield?)
Definition at line 308 of file simlib.h.
Referenced by operator delete(), SetName(), and SimObject().