Classes | Public Types | Public Member Functions

FbxIntrusiveList< T, NodeIndex > Class Template Reference

Search for all occurrences

Detailed Description

template<typename T, int NodeIndex = 0>
class FbxIntrusiveList< T, NodeIndex >

Definition at line 57 of file fbxintrusivelist.h.

#include <fbxintrusivelist.h>

List of all members.

Classes

class  IntrusiveListConstIterator
class  IntrusiveListIterator

Public Types

typedef T allocator_type
typedef T value_type
typedef T & reference
typedef const T & const_reference
typedef T * pointer
typedef const T * const_pointer
typedef FbxListNode< T > NodeT
typedef IntrusiveListIterator iterator
typedef IntrusiveListConstIterator const_iterator

Public Member Functions

 FbxIntrusiveList ()
 ~FbxIntrusiveList ()
bool Empty () const
void PushBack (T &pElement)
void PushFront (T &pElement)
void PopFront ()
void PopBack ()
iterator Begin ()
const_iterator Begin () const
iterator End ()
const_iterator End () const
reference Front ()
const_reference Front () const
reference Back ()
const_reference Back () const
iteratorErase (iterator &it)

Member Typedef Documentation

typedef T allocator_type

Definition at line 60 of file fbxintrusivelist.h.

typedef T value_type

Definition at line 61 of file fbxintrusivelist.h.

typedef T& reference

Definition at line 62 of file fbxintrusivelist.h.

typedef const T& const_reference

Definition at line 63 of file fbxintrusivelist.h.

typedef T* pointer

Definition at line 64 of file fbxintrusivelist.h.

typedef const T* const_pointer

Definition at line 65 of file fbxintrusivelist.h.

typedef FbxListNode<T> NodeT

Definition at line 67 of file fbxintrusivelist.h.


Constructor & Destructor Documentation

FbxIntrusiveList ( ) [inline]

Definition at line 70 of file fbxintrusivelist.h.

                      :mHead(0)
    {
        mHead.mNext = mHead.mPrev = &mHead;
    }
~FbxIntrusiveList ( ) [inline]

Definition at line 74 of file fbxintrusivelist.h.

    {
        while(!Empty())
            Begin().Get()->Disconnect();  // LINUXNote:  should be Erase(Begin()); but there's an issue with gcc 4.2
    };

Member Function Documentation

bool Empty ( ) const [inline]

Definition at line 81 of file fbxintrusivelist.h.

    {
        return ((mHead.mNext==&mHead)&&(mHead.mPrev==&mHead));
    }
void PushBack ( T &  pElement) [inline]

Definition at line 87 of file fbxintrusivelist.h.

    {
        NodeT* pNode = &pElement.GetListNode(NodeIndex);
        pNode->mData = &pElement;

        if (Empty())
        {
            pNode->mNext = &mHead;
            pNode->mPrev = &mHead;
            mHead.mNext = pNode;
            mHead.mPrev = pNode;
        }
        else
        {
            pNode->mNext = &mHead;
            pNode->mPrev = mHead.mPrev;

            pNode->mPrev->mNext = pNode;
            mHead.mPrev = pNode;
        }
    }
void PushFront ( T &  pElement) [inline]

Definition at line 109 of file fbxintrusivelist.h.

    {
        NodeT* pNode = &pElement.GetListNode(NodeIndex);
        pNode->mData = &pElement;

        if (Empty())
        {
            pNode->mNext = &mHead;
            pNode->mPrev = &mHead;
            mHead.mNext = pNode;
            mHead.mPrev = pNode;
        }
        else
        {
            pNode->mNext = mHead.mNext;
            pNode->mPrev = &mHead;

            pNode->mNext->mPrev = pNode;
            mHead.mNext = pNode;
        }
    }
void PopFront ( ) [inline]

Definition at line 131 of file fbxintrusivelist.h.

    {
        iterator begin = Begin();
        Erase(begin);
    }
void PopBack ( ) [inline]

Definition at line 137 of file fbxintrusivelist.h.

    {
        Erase(--(End()));
    }
iterator Begin ( ) [inline]

Definition at line 232 of file fbxintrusivelist.h.

{ return iterator(mHead.mNext); }
const_iterator Begin ( ) const [inline]

Definition at line 233 of file fbxintrusivelist.h.

{ return const_iterator(mHead.mNext); }
iterator End ( ) [inline]

Definition at line 234 of file fbxintrusivelist.h.

{ return iterator(&mHead); }
const_iterator End ( ) const [inline]

Definition at line 235 of file fbxintrusivelist.h.

{ return const_iterator(&mHead); }
reference Front ( ) [inline]

Definition at line 240 of file fbxintrusivelist.h.

{return (*Begin());}
const_reference Front ( ) const [inline]

Definition at line 241 of file fbxintrusivelist.h.

{ return (*Begin()); }
reference Back ( ) [inline]

Definition at line 242 of file fbxintrusivelist.h.

{ return (*(--End())); }
const_reference Back ( ) const [inline]

Definition at line 243 of file fbxintrusivelist.h.

{ return (*(--End())); }
iterator& Erase ( iterator it) [inline]

Definition at line 245 of file fbxintrusivelist.h.

    {
        it.Get()->Disconnect();
        return (++it);
    }

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