My Project
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | Friends
ListItem< T > Class Template Reference

#include <ftmpl_list.h>

Public Member Functions

 ListItem (const ListItem< T > &)
 
 ListItem (const T &, ListItem< T > *, ListItem< T > *)
 
 ListItem (T *, ListItem< T > *, ListItem< T > *)
 
 ~ListItem ()
 
ListItem< T > & operator= (const ListItem< T > &)
 
ListItem< T > * getNext ()
 
ListItem< T > * getPrev ()
 
TgetItem ()
 
void print (OSTREAM &)
 

Private Attributes

ListItemnext
 
ListItemprev
 
Titem
 

Friends

class ListIterator< T >
 
class List< T >
 

Detailed Description

template<class T>
class ListItem< T >

Definition at line 28 of file ftmpl_list.h.

Constructor & Destructor Documentation

◆ ListItem() [1/3]

template<class T >
ListItem< T >::ListItem ( const ListItem< T > &  i)

Definition at line 6 of file ftmpl_list.cc.

7{
8 next = i.next;
9 prev = i.prev;
10 item = i.item;
11}
int i
Definition: cfEzgcd.cc:132
ListItem * next
Definition: ftmpl_list.h:31
ListItem * prev
Definition: ftmpl_list.h:32
T * item
Definition: ftmpl_list.h:33

◆ ListItem() [2/3]

template<class T >
ListItem< T >::ListItem ( const T t,
ListItem< T > *  n,
ListItem< T > *  p 
)

Definition at line 15 of file ftmpl_list.cc.

16{
17 next = n;
18 prev = p;
19 item = new T( t );
20}
int p
Definition: cfModGcd.cc:4078
STATIC_VAR jList * T
Definition: janet.cc:30

◆ ListItem() [3/3]

template<class T >
ListItem< T >::ListItem ( T t,
ListItem< T > *  n,
ListItem< T > *  p 
)

Definition at line 24 of file ftmpl_list.cc.

25{
26 next = n;
27 prev = p;
28 item = t;
29}

◆ ~ListItem()

template<class T >
ListItem< T >::~ListItem

Definition at line 33 of file ftmpl_list.cc.

34{
35 delete item;
36}

Member Function Documentation

◆ getItem()

template<class T >
T & ListItem< T >::getItem

Definition at line 67 of file ftmpl_list.cc.

68{
69 return *item;
70}

◆ getNext()

template<class T >
ListItem< T > * ListItem< T >::getNext

Definition at line 53 of file ftmpl_list.cc.

54{
55 return next;
56}

◆ getPrev()

template<class T >
ListItem< T > * ListItem< T >::getPrev

Definition at line 60 of file ftmpl_list.cc.

61{
62 return prev;
63}

◆ operator=()

template<class T >
ListItem< T > & ListItem< T >::operator= ( const ListItem< T > &  i)

Definition at line 40 of file ftmpl_list.cc.

41{
42 if ( this != &i )
43 {
44 next = i.next;
45 prev = i.prev;
46 item = i.item;
47 }
48 return *this;
49}

◆ print()

template<class T >
void ListItem< T >::print ( OSTREAM os)

Definition at line 74 of file ftmpl_list.cc.

75{
76 if ( item )
77 os << *item;
78 else
79 os << "(no item)";
80}

Friends And Related Function Documentation

◆ List< T >

template<class T >
friend class List< T >
friend

Definition at line 44 of file ftmpl_list.h.

◆ ListIterator< T >

template<class T >
friend class ListIterator< T >
friend

Definition at line 44 of file ftmpl_list.h.

Field Documentation

◆ item

template<class T >
T* ListItem< T >::item
private

Definition at line 33 of file ftmpl_list.h.

◆ next

template<class T >
ListItem* ListItem< T >::next
private

Definition at line 31 of file ftmpl_list.h.

◆ prev

template<class T >
ListItem* ListItem< T >::prev
private

Definition at line 32 of file ftmpl_list.h.


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