ext/containers/list.bi

Summary
ext/containers/list.bi
LicenseCopyright © 2007-2011, FreeBASIC Extended Library Development Group
ListIterator__
Functions
default constructorConstructs an iterator.
GetReturns a reference to the list element being pointed to.
IncrementMoves the iterator forward in the list.
DecrementMoves the iterator backward in the list.
PostIncrementMoves the iterator forward in the list after returning its value.
PostDecrementMoves the iterator backward in the list after returning its value.
ListIteratorToConst__
Functions
conversion from ListIterator__ constructorConstructs an iterator.
default constructorConstructs an iterator.
GetGets a pointer that is constant to the referenced element.
IncrementMoves the iterator forward in the list.
DecrementMoves the iterator backward in the list.
PostIncrementMoves the iterator forward in the list after returning its value.
PostDecrementMoves the iterator backward in the list after returning its value.
dereferenceEquivalent to `fbext_ListIterator__( T_).Get()`.
dereferenceEquivalent to `fbext_ListIteratorToConst__( T_).Get()`.
global operator =Compares two iterators for equality.
global operator <>Compares two iterators for inequality.
List
Functions
default constructorConstructs an empty list.
copy constructorConstructs an empty list.
constructorConstructs a list from a range of list element values.
destructorDestroys the list.
operator letAssigns to the list from another.
AssignAssigns to the list from a range of list element values.
AssignAssigns to the list multiple copies of an element value.
SizeGets the number of elements in the list.
EmptyDetermines if the list contains no elements.
BeginGets an iterator to the first element in the list.
cBeginGets an iterator to the first element in the list.
End_Gets an iterator to one-past the last element in the list.
cEndGets an iterator to one-past the last element in the list.
FrontGets a reference to the first element in the list.
cFrontGets a reference to the first element in the list.
BackGets a reference to the last element in the list.
cBackGets a reference to the last element in the list.
PushFrontInserts an element value at the beginning of the list.
PushBackInserts an element value at the end of the list.
PopFrontRemoves the first element in the list.
PopBackRemoves the last element in the list.
InsertInserts an element value into the list.
InsertInserts a number of copies of an element value in the list.
InsertInserts a range of element values into the list.
EraseRemoves an element from the list.
EraseRemoves a range of elements from the list.
ClearRemoves all elements from the list.
RemoveIfRemoves elements from the list satisfying a predicate.

License

Copyright © 2007-2011, FreeBASIC Extended Library Development Group

Distributed under the FreeBASIC Extended Library Group license.  See accompanying file LICENSE.txt or copy at http://code.google.com/p/fb-extended-lib/wiki/License

ListIterator__

Summary
Functions
default constructorConstructs an iterator.
GetReturns a reference to the list element being pointed to.
IncrementMoves the iterator forward in the list.
DecrementMoves the iterator backward in the list.
PostIncrementMoves the iterator forward in the list after returning its value.
PostDecrementMoves the iterator backward in the list after returning its value.

Functions

default constructor

Constructs an iterator.

Parameters

nodethe List node to point to, used internally by List

Get

declare function Get () as fbext_TypeName( T_) ptr

Returns a reference to the list element being pointed to.

Increment

declare sub Increment ( )

Moves the iterator forward in the list.

Decrement

declare sub Decrement ( )

Moves the iterator backward in the list.

PostIncrement

declare function PostIncrement () as fbext_ListIterator__( T_)

Moves the iterator forward in the list after returning its value.

Returns

Returns the value of the iterator before being incremented.

PostDecrement

declare function PostDecrement () as fbext_ListIterator__( T_)

Moves the iterator backward in the list after returning its value.

Returns

Returns the value of the iterator before being decremented.

ListIteratorToConst__

Summary
Functions
conversion from ListIterator__ constructorConstructs an iterator.
default constructorConstructs an iterator.
GetGets a pointer that is constant to the referenced element.
IncrementMoves the iterator forward in the list.
DecrementMoves the iterator backward in the list.
PostIncrementMoves the iterator forward in the list after returning its value.
PostDecrementMoves the iterator backward in the list after returning its value.
dereferenceEquivalent to `fbext_ListIterator__( T_).Get()`.
dereferenceEquivalent to `fbext_ListIteratorToConst__( T_).Get()`.
global operator =Compares two iterators for equality.
global operator <>Compares two iterators for inequality.

Functions

conversion from ListIterator__ constructor

Constructs an iterator.

default constructor

Constructs an iterator.

Parameters

nodethe List node to point to, used internally by List

Get

declare function Get () as const fbext_TypeName( T_) ptr

Gets a pointer that is constant to the referenced element.

Increment

declare sub Increment ( )

Moves the iterator forward in the list.

Decrement

declare sub Decrement ( )

Moves the iterator backward in the list.

PostIncrement

declare function PostIncrement () as fbext_ListIteratorToConst__( T_)

Moves the iterator forward in the list after returning its value.

Returns

Returns the value of the iterator before being incremented.

PostDecrement

declare function PostDecrement () as fbext_ListIteratorToConst__( T_)

Moves the iterator backward in the list after returning its value.

Returns

Returns the value of the iterator before being decremented.

dereference

Equivalent to `fbext_ListIterator__( T_).Get()`.

dereference

Equivalent to `fbext_ListIteratorToConst__( T_).Get()`.

global operator =

Compares two iterators for equality.

Parameters

xan iterator
yanother iterator

Returns

Returns true if the iterators point to the same element, false otherwise.

global operator <>

Compares two iterators for inequality.

Parameters

xan iterator
yanother iterator

Returns

Returns true if the iterators do not point to the same element, false otherwise.

List

Summary
Functions
default constructorConstructs an empty list.
copy constructorConstructs an empty list.
constructorConstructs a list from a range of list element values.
destructorDestroys the list.
operator letAssigns to the list from another.
AssignAssigns to the list from a range of list element values.
AssignAssigns to the list multiple copies of an element value.
SizeGets the number of elements in the list.
EmptyDetermines if the list contains no elements.
BeginGets an iterator to the first element in the list.
cBeginGets an iterator to the first element in the list.
End_Gets an iterator to one-past the last element in the list.
cEndGets an iterator to one-past the last element in the list.
FrontGets a reference to the first element in the list.
cFrontGets a reference to the first element in the list.
BackGets a reference to the last element in the list.
cBackGets a reference to the last element in the list.
PushFrontInserts an element value at the beginning of the list.
PushBackInserts an element value at the end of the list.
PopFrontRemoves the first element in the list.
PopBackRemoves the last element in the list.
InsertInserts an element value into the list.
InsertInserts a number of copies of an element value in the list.
InsertInserts a range of element values into the list.
EraseRemoves an element from the list.
EraseRemoves a range of elements from the list.
ClearRemoves all elements from the list.
RemoveIfRemoves elements from the list satisfying a predicate.

Functions

default constructor

Constructs an empty list.

copy constructor

Constructs an empty list.

constructor

declare constructor (byval first as typeof(IteratorToConst),
byval last as typeof(IteratorToConst))

Constructs a list from a range of list element values.

Parameters

firstan iterator to the first element in the range
lastan iteratot to one-past the last element in the range

destructor

declare destructor ( )

Destroys the list.

operator let

declare operator let (byref x as const fbext_List(( T_)( Allocator_)))

Assigns to the list from another.

Parameters

xthe list to assign

Assign

declare sub Assign (byval first as typeof(IteratorToConst),
byval last as typeof(IteratorToConst))

Assigns to the list from a range of list element values.

Parameters

firstan iterator to the first element in the range
lastan iteratot to one-past the last element in the range

Assign

declare sub Assign (byval n as SizeType,
byref x as const fbext_TypeName( T_))

Assigns to the list multiple copies of an element value.

Parameters

nthe number of element values to assign
xthe element value to assign

Size

declare const function Size ( ) as SizeType

Gets the number of elements in the list.

Empty

declare const function Empty ( ) as bool

Determines if the list contains no elements.

Begin

declare function Begin () as typeof(Iterator)

Gets an iterator to the first element in the list.

cBegin

declare const function cBegin () as typeof(IteratorToConst)

Gets an iterator to the first element in the list.

End_

declare function End_ () as typeof(Iterator)

Gets an iterator to one-past the last element in the list.

cEnd

declare const function cEnd () as typeof(IteratorToConst)

Gets an iterator to one-past the last element in the list.

Front

declare function Front () as fbext_TypeName( T_) ptr

Gets a reference to the first element in the list.

cFront

declare const function cFront () as const fbext_TypeName( T_) ptr

Gets a reference to the first element in the list.

Back

declare function Back () as fbext_TypeName( T_) ptr

Gets a reference to the last element in the list.

cBack

declare const function cBack () as const fbext_TypeName( T_) ptr

Gets a reference to the last element in the list.

PushFront

declare sub PushFront (byref x as const fbext_TypeName( T_))

Inserts an element value at the beginning of the list.

Parameters

xthe element value to insert

PushBack

declare sub PushBack (byref x as const fbext_TypeName( T_))

Inserts an element value at the end of the list.

Parameters

xthe element value to insert

PopFront

declare sub PopFront ( )

Removes the first element in the list.

PopBack

declare sub PopBack ( )

Removes the last element in the list.

Insert

declare function Insert (
   byval position as typeof(Iterator),
   byref x as const fbext_TypeName( T_)
) as typeof(Iterator)

Inserts an element value into the list.

Parameters

positionan iterator to where insertion will take place
xthe element value to insert

Returns

Returns an iterator to the newly inserted element.

Insert

declare sub Insert (byval position as typeof(Iterator),
byval n as SizeType,
byref x as const fbext_TypeName( T_))

Inserts a number of copies of an element value in the list.

Parameters

positionan iterator to where insertion will take place
nthe number of copies to insert
xthe element value to insert

Insert

declare sub Insert (byval position as typeof(Iterator),
byval first as typeof(IteratorToConst),
byval last as typeof(IteratorToConst))

Inserts a range of element values into the list.

Parameters

positionan iterator to where insertion will take place
firstan iterator to the first element in the range to insert
lastan iterator to one-past the last element in the range to insert

Erase

declare function Erase (byval position as typeof(Iterator)) as typeof(Iterator)

Removes an element from the list.

Parameters

positionan iterator to the element to remove

Returns

Returns an iterator to the element after the element removed, or List.End_() if the last element was removed.

Erase

Removes a range of elements from the list.

Parameters

firstan iterator to the first element to remove
lastan iterator to one-past the last element to remove

Clear

declare sub Clear ( )

Removes all elements from the list.

RemoveIf

declare sub RemoveIf (
   byval pred as function ( byref as const fbext_TypeName( T_) ) as bool
)

Removes elements from the list satisfying a predicate.

Parameters

preda predicate that returns true if an element is to be removed, false otherwise.
declare function Get () as fbext_TypeName( T_) ptr
Returns a reference to the list element being pointed to.
declare sub Increment ( )
Moves the iterator forward in the list.
declare sub Decrement ( )
Moves the iterator backward in the list.
declare function PostIncrement () as fbext_ListIterator__( T_)
Moves the iterator forward in the list after returning its value.
declare function PostDecrement () as fbext_ListIterator__( T_)
Moves the iterator backward in the list after returning its value.
declare function Get () as const fbext_TypeName( T_) ptr
Gets a pointer that is constant to the referenced element.
declare sub Increment ( )
Moves the iterator forward in the list.
declare sub Decrement ( )
Moves the iterator backward in the list.
declare function PostIncrement () as fbext_ListIteratorToConst__( T_)
Moves the iterator forward in the list after returning its value.
declare function PostDecrement () as fbext_ListIteratorToConst__( T_)
Moves the iterator backward in the list after returning its value.
declare constructor (byval first as typeof(IteratorToConst),
byval last as typeof(IteratorToConst))
Constructs a list from a range of list element values.
declare destructor ( )
Destroys the list.
declare operator let (byref x as const fbext_List(( T_)( Allocator_)))
Assigns to the list from another.
declare sub Assign (byval first as typeof(IteratorToConst),
byval last as typeof(IteratorToConst))
Assigns to the list from a range of list element values.
declare const function Size ( ) as SizeType
Gets the number of elements in the list.
declare const function Empty ( ) as bool
Determines if the list contains no elements.
declare function Begin () as typeof(Iterator)
Gets an iterator to the first element in the list.
declare const function cBegin () as typeof(IteratorToConst)
Gets an iterator to the first element in the list.
declare function End_ () as typeof(Iterator)
Gets an iterator to one-past the last element in the list.
declare const function cEnd () as typeof(IteratorToConst)
Gets an iterator to one-past the last element in the list.
declare function Front () as fbext_TypeName( T_) ptr
Gets a reference to the first element in the list.
declare const function cFront () as const fbext_TypeName( T_) ptr
Gets a reference to the first element in the list.
declare function Back () as fbext_TypeName( T_) ptr
Gets a reference to the last element in the list.
declare const function cBack () as const fbext_TypeName( T_) ptr
Gets a reference to the last element in the list.
declare sub PushFront (byref x as const fbext_TypeName( T_))
Inserts an element value at the beginning of the list.
declare sub PushBack (byref x as const fbext_TypeName( T_))
Inserts an element value at the end of the list.
declare sub PopFront ( )
Removes the first element in the list.
declare sub PopBack ( )
Removes the last element in the list.
declare function Insert (
   byval position as typeof(Iterator),
   byref x as const fbext_TypeName( T_)
) as typeof(Iterator)
Inserts an element value into the list.
declare function Erase (byval position as typeof(Iterator)) as typeof(Iterator)
Removes an element from the list.
declare sub Clear ( )
Removes all elements from the list.
declare sub RemoveIf (
   byval pred as function ( byref as const fbext_TypeName( T_) ) as bool
)
Removes elements from the list satisfying a predicate.