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

list of Link* items, uses data from Link More...

#include <simlib.h>

Inheritance diagram for simlib3::List:
Collaboration diagram for simlib3::List:

Classes

class  iterator

Public Member Functions

 List ()
 List (const char *_name)
 ~List ()
virtual void Output () const override
 print object to default output
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
virtual Link * Get (iterator pos)
 remove at position
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

Static Private Member Functions

static Link * next (Link *p)
static Link * previous (Link *p)

Private Attributes

unsigned n

Friends

class iterator

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 }
Protected Attributes inherited from simlib3::SimObject
unsigned _flags
 bool flags for internal use (TODO bitfield?)

Detailed Description

list of Link* items, uses data from Link

Definition at line 635 of file simlib.h.

Constructor & Destructor Documentation

◆ List() [1/2]

simlib3::List::List ( )

Definition at line 33 of file list.cc.

References Dprintf, simlib3::Link::Link(), and n.

Referenced by iterator.

◆ List() [2/2]

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

Definition at line 38 of file list.cc.

References Dprintf, simlib3::Link::Link(), n, and simlib3::SetName().

◆ ~List()

simlib3::List::~List ( )

Definition at line 47 of file list.cc.

References clear(), Dprintf, simlib3::Link::head, and simlib3::SimObject::Name().

Member Function Documentation

◆ back()

Link * simlib3::List::back ( )
inline

Definition at line 680 of file simlib.h.

References empty(), simlib3::Link::Link(), and simlib3::Link::pred.

Referenced by simlib3::Queue::back().

◆ begin()

iterator simlib3::List::begin ( )
inline

Definition at line 677 of file simlib.h.

References simlib3::Link::succ.

Referenced by simlib3::Queue::begin(), GetFirst(), and Output().

◆ clear()

void simlib3::List::clear ( )

Definition at line 159 of file list.cc.

References empty(), GetFirst(), simlib3::SimObject::isAllocated(), and simlib3::Link::Link().

Referenced by simlib3::Queue::clear(), and ~List().

◆ empty()

bool simlib3::List::empty ( )
inline

◆ end()

iterator simlib3::List::end ( )
inline

Definition at line 678 of file simlib.h.

Referenced by simlib3::Queue::end(), Get(), GetLast(), Output(), and PostIns().

◆ front()

Link * simlib3::List::front ( )
inline

Definition at line 679 of file simlib.h.

References empty(), simlib3::Link::Link(), and simlib3::Link::succ.

Referenced by simlib3::Queue::front().

◆ Get()

◆ GetFirst()

Link * simlib3::List::GetFirst ( )

remove first

Definition at line 124 of file list.cc.

References begin(), Get(), and simlib3::Link::Link().

Referenced by clear(), and iterator.

◆ GetLast()

Link * simlib3::List::GetLast ( )

remove last

Definition at line 132 of file list.cc.

References end(), Get(), and simlib3::Link::Link().

Referenced by iterator.

◆ InsFirst()

void simlib3::List::InsFirst ( Link * e)

◆ InsLast()

void simlib3::List::InsLast ( Link * e)

◆ next()

Link * simlib3::List::next ( Link * p)
inlinestaticprivate

◆ Output()

void simlib3::List::Output ( ) const
overridevirtual

print object to default output

Reimplemented from simlib3::SimObject.

Reimplemented in simlib3::Queue.

Definition at line 44 of file output1.cc.

References begin(), end(), simlib3::SimObject::Name(), and simlib3::Print().

Referenced by iterator.

◆ PostIns()

void simlib3::List::PostIns ( Link * e,
iterator pos )

◆ PredIns()

void simlib3::List::PredIns ( Link * e,
iterator pos )

◆ previous()

Link * simlib3::List::previous ( Link * p)
inlinestaticprivate

◆ size()

unsigned simlib3::List::size ( ) const
inline

◆ iterator

friend class iterator
friend

Member Data Documentation

◆ n

unsigned simlib3::List::n
private

Definition at line 638 of file simlib.h.

Referenced by Get(), InsFirst(), InsLast(), List(), List(), PostIns(), PredIns(), and size().


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