Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Private Attributes | Friends
nsLineList Class Reference

#include <nsLineBox.h>

Collaboration diagram for nsLineList:
Collaboration graph
[legend]

List of all members.

Public Types

typedef PRUint32 size_type
typedef PRInt32 difference_type
typedef nsLineLink link_type
typedef nsLineList self_type
typedef nsLineBoxreference
typedef const nsLineBoxconst_reference
typedef nsLineBoxpointer
typedef const nsLineBoxconst_pointer
typedef nsLineList_iterator iterator
typedef nsLineList_reverse_iterator reverse_iterator
typedef nsLineList_const_iterator const_iterator
typedef
nsLineList_const_reverse_iterator 
const_reverse_iterator

Public Member Functions

 nsLineList ()
const_iterator begin () const
iterator begin ()
iterator begin (nsLineBox *aLine)
const_iterator end () const
iterator end ()
const_reverse_iterator rbegin () const
reverse_iterator rbegin ()
const_reverse_iterator rend () const
reverse_iterator rend ()
PRBool empty () const
size_type size () const
pointer front ()
const_pointer front () const
pointer back ()
const_pointer back () const
void push_front (pointer aNew)
void pop_front ()
void push_back (pointer aNew)
void pop_back ()
iterator before_insert (iterator position, pointer x)
iterator after_insert (iterator position, pointer x)
iterator erase (iterator position)
void swap (self_type &y)
void clear ()
void splice (iterator position, self_type &x)
void splice (iterator position, self_type &x, iterator i)
void splice (iterator position, self_type &x, iterator first, iterator last)

Private Attributes

link_type mLink

Friends

class nsLineList_iterator
class nsLineList_reverse_iterator
class nsLineList_const_iterator
class nsLineList_const_reverse_iterator

Detailed Description

Definition at line 1054 of file nsLineBox.h.


Member Typedef Documentation

Definition at line 1082 of file nsLineBox.h.

Definition at line 1078 of file nsLineBox.h.

Definition at line 1075 of file nsLineBox.h.

Definition at line 1083 of file nsLineBox.h.

Definition at line 1064 of file nsLineBox.h.

Definition at line 1080 of file nsLineBox.h.

Definition at line 1066 of file nsLineBox.h.

Definition at line 1077 of file nsLineBox.h.

Definition at line 1074 of file nsLineBox.h.

Definition at line 1081 of file nsLineBox.h.

Definition at line 1072 of file nsLineBox.h.

Definition at line 1063 of file nsLineBox.h.


Constructor & Destructor Documentation

nsLineList::nsLineList ( ) [inline]

Definition at line 1085 of file nsLineBox.h.

    {
      clear();
    }

Here is the call graph for this function:


Member Function Documentation

iterator nsLineList::after_insert ( iterator  position,
pointer  x 
) [inline]

Definition at line 1272 of file nsLineBox.h.

    {
      // use |mCurrent| to prevent DEBUG_PASS_END assertions
      x->_mNext = position.mCurrent->_mNext;
      x->_mPrev = position.mCurrent;
      position.mCurrent->_mNext->_mPrev = x;
      position.mCurrent->_mNext = x;
      return ++position;
    }

Here is the caller graph for this function:

pointer nsLineList::back ( ) [inline]

Definition at line 1210 of file nsLineBox.h.

    {
      NS_ASSERTION(!empty(), "no element to return");
      return NS_STATIC_CAST(pointer, mLink._mPrev);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

const_pointer nsLineList::back ( ) const [inline]

Definition at line 1216 of file nsLineBox.h.

    {
      NS_ASSERTION(!empty(), "no element to return");
      return NS_STATIC_CAST(const_pointer, mLink._mPrev);
    }

Here is the call graph for this function:

iterator nsLineList::before_insert ( iterator  position,
pointer  x 
) [inline]

Definition at line 1261 of file nsLineBox.h.

    {
      // use |mCurrent| to prevent DEBUG_PASS_END assertions
      x->_mPrev = position.mCurrent->_mPrev;
      x->_mNext = position.mCurrent;
      position.mCurrent->_mPrev->_mNext = x;
      position.mCurrent->_mPrev = x;
      return --position;
    }

Here is the caller graph for this function:

const_iterator nsLineList::begin ( ) const [inline]

Definition at line 1090 of file nsLineBox.h.

    {
      const_iterator rv;
      rv.mCurrent = mLink._mNext;
#ifdef NS_LINELIST_DEBUG_PASS_END
      rv.mListLink = &mLink;
#endif
      return rv;
    }

Here is the caller graph for this function:

Definition at line 1100 of file nsLineBox.h.

    {
      iterator rv;
      rv.mCurrent = mLink._mNext;
#ifdef NS_LINELIST_DEBUG_PASS_END
      rv.mListLink = &mLink;
#endif
      return rv;
    }
iterator nsLineList::begin ( nsLineBox aLine) [inline]

Definition at line 1110 of file nsLineBox.h.

    {
      iterator rv;
      rv.mCurrent = aLine;
#ifdef NS_LINELIST_DEBUG_PASS_END
      rv.mListLink = &mLink;
#endif
      return rv;
    }
void nsLineList::clear ( void  ) [inline]

Definition at line 1298 of file nsLineBox.h.

Here is the caller graph for this function:

PRBool nsLineList::empty ( ) const [inline]

Definition at line 1180 of file nsLineBox.h.

    {
      return mLink._mNext == &mLink;
    }

Here is the caller graph for this function:

const_iterator nsLineList::end ( ) const [inline]

Definition at line 1120 of file nsLineBox.h.

    {
      const_iterator rv;
      rv.mCurrent = &mLink;
#ifdef NS_LINELIST_DEBUG_PASS_END
      rv.mListLink = &mLink;
#endif
      return rv;
    }

Here is the caller graph for this function:

iterator nsLineList::end ( ) [inline]

Definition at line 1130 of file nsLineBox.h.

    {
      iterator rv;
      rv.mCurrent = &mLink;
#ifdef NS_LINELIST_DEBUG_PASS_END
      rv.mListLink = &mLink;
#endif
      return rv;
    }
iterator nsLineList::erase ( iterator  position) [inline]

Definition at line 1283 of file nsLineBox.h.

    {
      position->_mPrev->_mNext = position->_mNext;
      position->_mNext->_mPrev = position->_mPrev;
      return ++position;
    }

Here is the caller graph for this function:

pointer nsLineList::front ( ) [inline]

Definition at line 1198 of file nsLineBox.h.

    {
      NS_ASSERTION(!empty(), "no element to return");
      return NS_STATIC_CAST(pointer, mLink._mNext);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

const_pointer nsLineList::front ( ) const [inline]

Definition at line 1204 of file nsLineBox.h.

    {
      NS_ASSERTION(!empty(), "no element to return");
      return NS_STATIC_CAST(const_pointer, mLink._mNext);
    }

Here is the call graph for this function:

void nsLineList::pop_back ( ) [inline]

Definition at line 1249 of file nsLineBox.h.

    {
      NS_ASSERTION(!empty(), "no element to pop");
      link_type *newLast = mLink._mPrev->_mPrev;
      newLast->_mNext = &mLink;
      // mLink._mPrev->_mPrev = nsnull;
      // mLink._mPrev->_mNext = nsnull;
      mLink._mPrev = newLast;
    }

Here is the call graph for this function:

Definition at line 1230 of file nsLineBox.h.

    {
      NS_ASSERTION(!empty(), "no element to pop");
      link_type *newFirst = mLink._mNext->_mNext;
      newFirst->_mPrev = &mLink;
      // mLink._mNext->_mNext = nsnull;
      // mLink._mNext->_mPrev = nsnull;
      mLink._mNext = newFirst;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void nsLineList::push_back ( pointer  aNew) [inline]

Definition at line 1241 of file nsLineBox.h.

    {
      aNew->_mPrev = mLink._mPrev;
      mLink._mPrev->_mNext = aNew;
      aNew->_mNext = &mLink;
      mLink._mPrev = aNew;
    }

Here is the caller graph for this function:

void nsLineList::push_front ( pointer  aNew) [inline]

Definition at line 1222 of file nsLineBox.h.

    {
      aNew->_mNext = mLink._mNext;
      mLink._mNext->_mPrev = aNew;
      aNew->_mPrev = &mLink;
      mLink._mNext = aNew;
    }

Here is the caller graph for this function:

Definition at line 1140 of file nsLineBox.h.

    {
      const_reverse_iterator rv;
      rv.mCurrent = mLink._mPrev;
#ifdef NS_LINELIST_DEBUG_PASS_END
      rv.mListLink = &mLink;
#endif
      return rv;
    }

Here is the caller graph for this function:

Definition at line 1150 of file nsLineBox.h.

    {
      reverse_iterator rv;
      rv.mCurrent = mLink._mPrev;
#ifdef NS_LINELIST_DEBUG_PASS_END
      rv.mListLink = &mLink;
#endif
      return rv;
    }

Definition at line 1160 of file nsLineBox.h.

    {
      const_reverse_iterator rv;
      rv.mCurrent = &mLink;
#ifdef NS_LINELIST_DEBUG_PASS_END
      rv.mListLink = &mLink;
#endif
      return rv;
    }

Here is the caller graph for this function:

Definition at line 1170 of file nsLineBox.h.

    {
      reverse_iterator rv;
      rv.mCurrent = &mLink;
#ifdef NS_LINELIST_DEBUG_PASS_END
      rv.mListLink = &mLink;
#endif
      return rv;
    }
size_type nsLineList::size ( ) const [inline]

Definition at line 1186 of file nsLineBox.h.

    {
      size_type count = 0;
      for (const link_type *cur = mLink._mNext;
           cur != &mLink;
           cur = cur->_mNext)
      {
        ++count;
      }
      return count;
    }

Here is the caller graph for this function:

void nsLineList::splice ( iterator  position,
self_type x 
) [inline]

Definition at line 1306 of file nsLineBox.h.

    {
      // use |mCurrent| to prevent DEBUG_PASS_END assertions
      position.mCurrent->_mPrev->_mNext = x.mLink._mNext;
      x.mLink._mNext->_mPrev = position.mCurrent->_mPrev;
      x.mLink._mPrev->_mNext = position.mCurrent;
      position.mCurrent->_mPrev = x.mLink._mPrev;
      x.clear();
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void nsLineList::splice ( iterator  position,
self_type x,
iterator  i 
) [inline]

Definition at line 1318 of file nsLineBox.h.

    {
      NS_ASSERTION(!x.empty(), "Can't insert from empty list.");
      NS_ASSERTION(position != i && position.mCurrent != i->_mNext,
                   "We don't check for this case.");

      // remove from |x|
      i->_mPrev->_mNext = i->_mNext;
      i->_mNext->_mPrev = i->_mPrev;

      // use |mCurrent| to prevent DEBUG_PASS_END assertions
      // link into |this|, before-side
      i->_mPrev = position.mCurrent->_mPrev;
      position.mCurrent->_mPrev->_mNext = i.get();

      // link into |this|, after-side
      i->_mNext = position.mCurrent;
      position.mCurrent->_mPrev = i.get();
    }

Here is the call graph for this function:

void nsLineList::splice ( iterator  position,
self_type x,
iterator  first,
iterator  last 
) [inline]

Definition at line 1340 of file nsLineBox.h.

    {
      NS_ASSERTION(!x.empty(), "Can't insert from empty list.");

      if (first == last)
        return;

      --last; // so we now want to move [first, last]
      // remove from |x|
      first->_mPrev->_mNext = last->_mNext;
      last->_mNext->_mPrev = first->_mPrev;

      // use |mCurrent| to prevent DEBUG_PASS_END assertions
      // link into |this|, before-side
      first->_mPrev = position.mCurrent->_mPrev;
      position.mCurrent->_mPrev->_mNext = first.get();

      // link into |this|, after-side
      last->_mNext = position.mCurrent;
      position.mCurrent->_mPrev = last.get();
    }

Here is the call graph for this function:

void nsLineList::swap ( self_type y) [inline]

Definition at line 1291 of file nsLineBox.h.

    {
      link_type tmp(y.mLink);
      y.mLink = mLink;
      mLink = tmp;
    }

Friends And Related Function Documentation

friend class nsLineList_const_iterator [friend]

Definition at line 1060 of file nsLineBox.h.

friend class nsLineList_const_reverse_iterator [friend]

Definition at line 1061 of file nsLineBox.h.

friend class nsLineList_iterator [friend]

Definition at line 1058 of file nsLineBox.h.

friend class nsLineList_reverse_iterator [friend]

Definition at line 1059 of file nsLineBox.h.


Member Data Documentation

Definition at line 1069 of file nsLineBox.h.


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