Dillo v3.1.1-14-g8f67d6e0
Loading...
Searching...
No Matches
lout::container::untyped::List Class Reference

A single-linked list. More...

#include <container.hh>

Classes

class  ListIterator
 
struct  Node
 

Public Member Functions

 List (bool ownerOfObjects)
 
 ~List ()
 
bool equals (Object *other)
 Returns, whether two objects are equal.
 
int hashValue ()
 Return a hash value for the object.
 
int size ()
 
void clear ()
 
void append (object::Object *element)
 
bool insertBefore (object::Object *beforeThis, object::Object *neew)
 
bool removeRef (object::Object *element)
 
bool remove (object::Object *element)
 
bool detachRef (object::Object *element)
 
int size () const
 
bool isEmpty () const
 
object::ObjectgetFirst () const
 
object::ObjectgetLast () const
 
- Public Member Functions inherited from lout::container::untyped::Collection
void intoStringBuffer (misc::StringBuffer *sb)
 Store a textual representation of the object in a misc::StringBuffer.
 
Iterator iterator ()
 
- Public Member Functions inherited from lout::object::Object
virtual ~Object ()
 The destructor is defined as virtual (but not abstract), so that destruction of Object's works properly.
 
virtual Objectclone ()
 Return an exact copy of the object.
 
const char * toString ()
 Use object::Object::intoStringBuffer to return a textual representation of the object.
 
virtual size_t sizeOf ()
 Return the number of bytes, this object totally uses.
 

Protected Member Functions

AbstractIteratorcreateIterator ()
 

Private Member Functions

bool remove0 (object::Object *element, bool compare, bool doNotDeleteAtAll)
 

Private Attributes

Nodefirst
 
Nodelast
 
bool ownerOfObjects
 
int numElements
 

Friends

class ListIterator
 

Detailed Description

A single-linked list.

Definition at line 186 of file container.hh.

Constructor & Destructor Documentation

◆ List()

lout::container::untyped::List::List ( bool  ownerOfObjects)

◆ ~List()

lout::container::untyped::List::~List ( )

Definition at line 305 of file container.cc.

References lout::container::untyped::Vector::clear().

Member Function Documentation

◆ append()

void lout::container::untyped::List::append ( object::Object element)

◆ clear()

◆ createIterator()

Collection0::AbstractIterator * lout::container::untyped::List::createIterator ( )
protectedvirtual

Implements lout::container::untyped::Collection0.

Definition at line 436 of file container.cc.

◆ detachRef()

bool lout::container::untyped::List::detachRef ( object::Object element)
inline

Definition at line 233 of file container.hh.

References remove0().

◆ equals()

bool lout::container::untyped::List::equals ( Object other)
virtual

Returns, whether two objects are equal.

The caller should ensure, that this and the object have the same class; this makes casting of "other" safe. Typically, an implementation should check this == other first, the caller can assume a fast implementation.

Reimplemented from lout::object::Object.

Definition at line 315 of file container.cc.

References lout::object::Object::equals(), first, lout::container::untyped::List::Node::next, and lout::container::untyped::List::Node::object.

◆ getFirst()

object::Object * lout::container::untyped::List::getFirst ( ) const
inline

Definition at line 237 of file container.hh.

References first, and lout::container::untyped::List::Node::object.

◆ getLast()

object::Object * lout::container::untyped::List::getLast ( ) const
inline

Definition at line 238 of file container.hh.

References last, and lout::container::untyped::List::Node::object.

◆ hashValue()

int lout::container::untyped::List::hashValue ( )
virtual

Return a hash value for the object.

Reimplemented from lout::object::Object.

Definition at line 328 of file container.cc.

References lout::object::Object::hashValue(), lout::container::untyped::List::Node::next, and lout::container::untyped::List::Node::object.

◆ insertBefore()

bool lout::container::untyped::List::insertBefore ( object::Object beforeThis,
object::Object neew 
)

◆ isEmpty()

bool lout::container::untyped::List::isEmpty ( ) const
inline

Definition at line 236 of file container.hh.

References numElements.

◆ remove()

bool lout::container::untyped::List::remove ( object::Object element)
inline

Definition at line 231 of file container.hh.

References remove0().

◆ remove0()

bool lout::container::untyped::List::remove0 ( object::Object element,
bool  compare,
bool  doNotDeleteAtAll 
)
private

◆ removeRef()

bool lout::container::untyped::List::removeRef ( object::Object element)
inline

Definition at line 229 of file container.hh.

References remove0().

◆ size() [1/2]

int lout::container::untyped::List::size ( )
virtual

◆ size() [2/2]

int lout::container::untyped::List::size ( ) const
inline

Definition at line 235 of file container.hh.

References numElements.

Friends And Related Symbol Documentation

◆ ListIterator

friend class ListIterator
friend

Definition at line 188 of file container.hh.

Member Data Documentation

◆ first

Node* lout::container::untyped::List::first
private

Definition at line 208 of file container.hh.

Referenced by equals(), and getFirst().

◆ last

Node * lout::container::untyped::List::last
private

Definition at line 208 of file container.hh.

Referenced by getLast().

◆ numElements

int lout::container::untyped::List::numElements
private

Definition at line 210 of file container.hh.

Referenced by isEmpty(), and size().

◆ ownerOfObjects

bool lout::container::untyped::List::ownerOfObjects
private

Definition at line 209 of file container.hh.


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