Free Electron
Public Member Functions | Private Member Functions | Private Attributes | List of all members
fe::ListCore::Context Class Reference

A view state into an fe::List <> More...

#include <List.h>

Inheritance diagram for fe::ListCore::Context:
Inheritance graph
[legend]

Public Member Functions

 Context (const Context &operand)
 Copy constructor. More...
 
Contextoperator= (Context &operand)
 Copy state from another context. More...
 
void init (void)
 Reinitialize state. More...
 
NodeCore * current (void)
 Get current position on list. More...
 
void setCurrent (NodeCore *set)
 Set current position on list. More...
 
void setAtTailNull (BWORD set)
 Set whether context is after the tail. More...
 
BWORD isAtTailNull (void) const
 Get whether context is after the tail. More...
 

Private Member Functions

void checkValid (void)
 

Private Attributes

NodeCore * m_pCurrent
 
BWORD m_at_tail
 

Detailed Description

A view state into an fe::List <>

Do not access Context members except indirectly through List.

If you like iterators better, use fe::List::Iterator which wraps an fe::List::Context.

Context is similar to an iterator except that it does not contain a pointer to an List<>. All access to an List<> is done directly through List<> member functions with an Context argument. This means that Context is generic and does not need to be templated. The context is very lightweight and has no template instantiation. No special permissions are needed for context to list accesses. Your code always explicitly says which list it is accessing.

Constructor & Destructor Documentation

◆ Context()

fe::ListCore::Context::Context ( const Context operand)
inline

Copy constructor.

Member Function Documentation

◆ current()

NodeCore* fe::ListCore::Context::current ( void  )
inline

◆ init()

void fe::ListCore::Context::init ( void  )
inline

Reinitialize state.

◆ isAtTailNull()

BWORD fe::ListCore::Context::isAtTailNull ( void  ) const
inline

Get whether context is after the tail.

References fe::checkValid().

Referenced by fe::ListCore::isAtHeadNull(), fe::ListCore::isAtTailNull(), and operator=().

◆ operator=()

Context& fe::ListCore::Context::operator= ( Context operand)
inline

Copy state from another context.

References current(), and isAtTailNull().

◆ setAtTailNull()

void fe::ListCore::Context::setAtTailNull ( BWORD  set)
inline

Set whether context is after the tail.

Referenced by fe::List< fe::sp< fe::Component > >::postDecrement().

◆ setCurrent()

void fe::ListCore::Context::setCurrent ( NodeCore *  set)
inline

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