PPL  1.2
Parma_Polyhedra_Library::Implementation::Doubly_Linked_Object Class Reference

A (base) class for doubly linked objects. More...

#include <Doubly_Linked_Object_defs.hh>

Inheritance diagram for Parma_Polyhedra_Library::Implementation::Doubly_Linked_Object:
Collaboration diagram for Parma_Polyhedra_Library::Implementation::Doubly_Linked_Object:

Public Member Functions

 Doubly_Linked_Object ()
 Default constructor. More...
 
 Doubly_Linked_Object (Doubly_Linked_Object *f, Doubly_Linked_Object *b)
 Creates a chain element with forward link f and backward link b. More...
 
void insert_before (Doubly_Linked_Object &y)
 Inserts y before *this. More...
 
void insert_after (Doubly_Linked_Object &y)
 Inserts y after *this. More...
 
Doubly_Linked_Objecterase ()
 Erases *this from the chain and returns a pointer to the next element. More...
 
 ~Doubly_Linked_Object ()
 Erases *this from the chain. More...
 

Private Attributes

Doubly_Linked_Objectnext
 Forward link. More...
 
Doubly_Linked_Objectprev
 Backward link. More...
 

Friends

template<typename T >
class EList
 
template<typename T >
class EList_Iterator
 

Detailed Description

A (base) class for doubly linked objects.

Definition at line 32 of file Doubly_Linked_Object_defs.hh.

Constructor & Destructor Documentation

Parma_Polyhedra_Library::Implementation::Doubly_Linked_Object::Doubly_Linked_Object ( )
inline

Default constructor.

Definition at line 32 of file Doubly_Linked_Object_inlines.hh.

32  {
33 }
Parma_Polyhedra_Library::Implementation::Doubly_Linked_Object::Doubly_Linked_Object ( Doubly_Linked_Object f,
Doubly_Linked_Object b 
)
inline

Creates a chain element with forward link f and backward link b.

Definition at line 36 of file Doubly_Linked_Object_inlines.hh.

38  : next(f),
39  prev(b) {
40 }
Parma_Polyhedra_Library::Implementation::Doubly_Linked_Object::~Doubly_Linked_Object ( )
inline

Erases *this from the chain.

Definition at line 66 of file Doubly_Linked_Object_inlines.hh.

References erase().

66  {
67  erase();
68 }
Doubly_Linked_Object * erase()
Erases *this from the chain and returns a pointer to the next element.

Member Function Documentation

Doubly_Linked_Object * Parma_Polyhedra_Library::Implementation::Doubly_Linked_Object::erase ( )
inline

Erases *this from the chain and returns a pointer to the next element.

Definition at line 59 of file Doubly_Linked_Object_inlines.hh.

References next, and prev.

Referenced by ~Doubly_Linked_Object().

59  {
60  next->prev = prev;
61  prev->next = next;
62  return next;
63 }
void Parma_Polyhedra_Library::Implementation::Doubly_Linked_Object::insert_after ( Doubly_Linked_Object y)
inline

Inserts y after *this.

Definition at line 51 of file Doubly_Linked_Object_inlines.hh.

References next, and prev.

51  {
52  y.next = next;
53  y.prev = this;
54  next->prev = &y;
55  next = &y;
56 }
void Parma_Polyhedra_Library::Implementation::Doubly_Linked_Object::insert_before ( Doubly_Linked_Object y)
inline

Inserts y before *this.

Definition at line 43 of file Doubly_Linked_Object_inlines.hh.

References next, and prev.

43  {
44  y.next = this;
45  y.prev = prev;
46  prev->next = &y;
47  prev = &y;
48 }

Friends And Related Function Documentation

template<typename T >
friend class EList
friend

Definition at line 59 of file Doubly_Linked_Object_defs.hh.

template<typename T >
friend class EList_Iterator
friend

Definition at line 60 of file Doubly_Linked_Object_defs.hh.

Member Data Documentation

Doubly_Linked_Object* Parma_Polyhedra_Library::Implementation::Doubly_Linked_Object::next
private

Forward link.

Definition at line 54 of file Doubly_Linked_Object_defs.hh.

Referenced by erase(), insert_after(), and insert_before().

Doubly_Linked_Object* Parma_Polyhedra_Library::Implementation::Doubly_Linked_Object::prev
private

Backward link.

Definition at line 57 of file Doubly_Linked_Object_defs.hh.

Referenced by erase(), insert_after(), and insert_before().


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