BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
GmsList Class Reference

#include <GmsList.h>

Public Member Functions

 GmsList ()
virtual ~GmsList ()
GmsListLinklast () const
GmsListLinkfirst () const
unsigned int count () const
GmsListappend (GmsListLink *)
GmsListprepend (GmsListLink *)
GmsListremove (GmsListLink *)
GmsListinsertAfter (GmsListLink *link, GmsListLink *insertHere)
GmsListmoveAfter (GmsListLink *link, GmsListLink *insertHere)
void reset ()
 GmsList ()
virtual ~GmsList ()
GmsListLinklast () const
GmsListLinkfirst () const
unsigned int count () const
GmsListappend (GmsListLink *)
GmsListprepend (GmsListLink *)
GmsListremove (GmsListLink *)
GmsListinsertAfter (GmsListLink *link, GmsListLink *insertHere)
GmsListmoveAfter (GmsListLink *link, GmsListLink *insertHere)
void reset ()
 GmsList ()
virtual ~GmsList ()
GmsListLinklast () const
GmsListLinkfirst () const
unsigned int count () const
GmsListappend (GmsListLink *)
GmsListprepend (GmsListLink *)
GmsListremove (GmsListLink *)
GmsListinsertAfter (GmsListLink *link, GmsListLink *insertHere)
GmsListmoveAfter (GmsListLink *link, GmsListLink *insertHere)
void reset ()

Protected Attributes

GmsListLink_first
GmsListLink_last
unsigned int _count

Detailed Description

Constructor & Destructor Documentation

◆ GmsList() [1/3]

◆ ~GmsList() [1/3]

GmsList::~GmsList ( )
virtual

Definition at line 18 of file GmsList.cxx.

18{}

◆ GmsList() [2/3]

GmsList::GmsList ( )
inline

Definition at line 37 of file InstallArea/x86_64-el9-gcc13-opt/include/MdcTrkRecon/GmsList.h.

37 {
38 _first = _last = 0;
39 _count = 0;
40 }

◆ ~GmsList() [2/3]

virtual GmsList::~GmsList ( )
virtual

◆ GmsList() [3/3]

GmsList::GmsList ( )
inline

Definition at line 37 of file Reconstruction/MdcPatRec/MdcTrkRecon/include/MdcTrkRecon/GmsList.h.

37 {
38 _first = _last = 0;
39 _count = 0;
40 }

◆ ~GmsList() [3/3]

virtual GmsList::~GmsList ( )
virtual

Member Function Documentation

◆ append() [1/3]

GmsList & GmsList::append ( GmsListLink * l)

Definition at line 20 of file GmsList.cxx.

20 { // add an item to the end of a list
21 if ( _last )
22 {
23 _last->_next = l;
24 l->_prev = _last;
25 }
26 else _first = l;
27
28 _last = l;
29
30 _count++;
31
32 return *this;
33}

◆ append() [2/3]

GmsList & GmsList::append ( GmsListLink * )

◆ append() [3/3]

GmsList & GmsList::append ( GmsListLink * )

◆ count() [1/3]

unsigned int GmsList::count ( ) const
inline

◆ count() [2/3]

unsigned int GmsList::count ( ) const
inline

◆ count() [3/3]

unsigned int GmsList::count ( ) const
inline

◆ first() [1/3]

◆ first() [2/3]

GmsListLink * GmsList::first ( ) const
inline

◆ first() [3/3]

GmsListLink * GmsList::first ( ) const
inline

◆ insertAfter() [1/3]

GmsList & GmsList::insertAfter ( GmsListLink * link,
GmsListLink * insertHere )

Definition at line 49 of file GmsList.cxx.

50 { // add an item to the middle of a list
51 GmsListLink* after = 0;
52 if ( here != 0 )
53 {
54 after = here->_next;
55 here->_next = l;
56 l->_prev = here;
57 }
58 else
59 {
60 after = _first;
61 l->_prev = 0;
62 _first = l;
63 }
64 l->_next = after;
65
66 if ( after == 0 ) { _last = l; }
67 else { after->_prev = l; }
68
69 _count++;
70
71 return *this;
72}

◆ insertAfter() [2/3]

GmsList & GmsList::insertAfter ( GmsListLink * link,
GmsListLink * insertHere )

◆ insertAfter() [3/3]

GmsList & GmsList::insertAfter ( GmsListLink * link,
GmsListLink * insertHere )

◆ last() [1/3]

GmsListLink * GmsList::last ( ) const
inline

Definition at line 42 of file InstallArea/x86_64-el9-gcc13-dbg/include/MdcTrkRecon/GmsList.h.

42{ return _last; }

◆ last() [2/3]

GmsListLink * GmsList::last ( ) const
inline

Definition at line 42 of file InstallArea/x86_64-el9-gcc13-opt/include/MdcTrkRecon/GmsList.h.

42{ return _last; }

◆ last() [3/3]

GmsListLink * GmsList::last ( ) const
inline

◆ moveAfter() [1/3]

GmsList & GmsList::moveAfter ( GmsListLink * link,
GmsListLink * insertHere )

Definition at line 73 of file GmsList.cxx.

73 { // add an item from one
74 // place in list to another
75
76 // First remove it from its current position
77 if ( l == _first ) _first = _first->_next;
78 if ( l == _last ) _last = _last->_prev;
79
80 if ( l->_next ) { l->_next->_prev = l->_prev; }
81 if ( l->_prev ) { l->_prev->_next = l->_next; }
82
83 GmsListLink* after = 0;
84 if ( here != 0 )
85 {
86 after = here->_next;
87 here->_next = l;
88 l->_prev = here;
89 }
90 else
91 {
92 after = _first;
93 l->_prev = 0;
94 _first = l;
95 }
96 l->_next = after;
97
98 if ( after == 0 ) { _last = l; }
99 else { after->_prev = l; }
100
101 return *this;
102}

◆ moveAfter() [2/3]

GmsList & GmsList::moveAfter ( GmsListLink * link,
GmsListLink * insertHere )

◆ moveAfter() [3/3]

GmsList & GmsList::moveAfter ( GmsListLink * link,
GmsListLink * insertHere )

◆ prepend() [1/3]

GmsList & GmsList::prepend ( GmsListLink * l)

Definition at line 35 of file GmsList.cxx.

35 { // add an item to the beginning of a list
36 if ( _first )
37 {
38 _first->_prev = l;
39 l->_next = _first;
40 }
41 else _last = l;
42
43 _first = l;
44
45 _count++;
46
47 return *this;
48}

◆ prepend() [2/3]

GmsList & GmsList::prepend ( GmsListLink * )

◆ prepend() [3/3]

GmsList & GmsList::prepend ( GmsListLink * )

◆ remove() [1/3]

GmsList & GmsList::remove ( GmsListLink * l)

Definition at line 104 of file GmsList.cxx.

104 { // remove an item from the list
105 if ( l == _first ) _first = _first->_next;
106 if ( l == _last ) _last = _last->_prev;
107
108 if ( l->_next ) { l->_next->_prev = l->_prev; }
109 if ( l->_prev ) { l->_prev->_next = l->_next; }
110 l->_next = 0;
111 l->_prev = 0;
112
113 _count--;
114
115 return *this;
116}

◆ remove() [2/3]

GmsList & GmsList::remove ( GmsListLink * )

◆ remove() [3/3]

GmsList & GmsList::remove ( GmsListLink * )

◆ reset() [1/3]

void GmsList::reset ( )
inline

Definition at line 52 of file InstallArea/x86_64-el9-gcc13-dbg/include/MdcTrkRecon/GmsList.h.

52 {
53 _first = _last = 0;
54 _count = 0;
55 }

◆ reset() [2/3]

void GmsList::reset ( )
inline

Definition at line 52 of file InstallArea/x86_64-el9-gcc13-opt/include/MdcTrkRecon/GmsList.h.

52 {
53 _first = _last = 0;
54 _count = 0;
55 }

◆ reset() [3/3]

void GmsList::reset ( )
inline

Definition at line 52 of file Reconstruction/MdcPatRec/MdcTrkRecon/include/MdcTrkRecon/GmsList.h.

52 {
53 _first = _last = 0;
54 _count = 0;
55 }

Member Data Documentation

◆ _count

unsigned int GmsList::_count
protected

◆ _first

◆ _last


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