| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Foreign.Hoppy.Generator.Std.Iterator
Description
Support for STL-style iterators. The functions in this module modify a
class to add functionality that is provided by different types of STL
iterators. In the method pseudotypes documented here, the parameter types
are Types, and all methods are nonpure.
- data IteratorMutability
- makeTrivialIterator :: IteratorMutability -> Maybe Type -> Class -> Class
- makeForwardIterator :: IteratorMutability -> Maybe Type -> Class -> Class
- makeBidirectionalIterator :: IteratorMutability -> Maybe Type -> Class -> Class
- makeRandomIterator :: IteratorMutability -> Maybe Type -> Type -> Class -> Class
Documentation
data IteratorMutability Source
Whether an iterator may be used to modify the underlying collection.
makeTrivialIterator :: IteratorMutability -> Maybe Type -> Class -> Class Source
makeTrivialIteartor mutable valueTypeMaybe cls turns a class into a
trivial iterator, adding:
- A default constructor named
new. - The class features
Assignable,Copyable, andEquatable. - operator*:
getConst :: this ->; ifTRef(TConstvalueType)valueTypeMaybeis present. - operator*:
get :: this ->; ifTRefvalueTypevalueTypeMaybeis present andmutableisMutable. - *iter = x:
put :: this -> valueType ->; ifTVoidvalueTypeMaybeis present andmutableisMutable.
makeForwardIterator :: IteratorMutability -> Maybe Type -> Class -> Class Source
Turns a class into a forward iterator, including everything from
makeTrivialIterator plus the pre-increment operator:
makeBidirectionalIterator :: IteratorMutability -> Maybe Type -> Class -> Class Source
Turns a class into a bidirectional iterator, including everything from
makeForwardIterator plus the pre-decrement operator:
makeRandomIterator :: IteratorMutability -> Maybe Type -> Type -> Class -> Class Source
makeRandomIterator mutable valueTypeMaybe distanceType cls turns a class
into a random iterator, including everything from makeBidirectionalIterator
plus some methods:
- operator+=:
add :: this -> distanceType ->.TRef(TObjcls) - operator+:
plusNew :: this -> distanceType ->.TObjToHeapcls - operator-=:
subtract :: distanceType ->.TRef(TObjcls) - operator-:
minusNew :: distanceType ->.TObjToHeapcls - operator-:
difference :: this -> this -> distanceType. - operator[]:
atConst :: distanceType ->; ifTRef(TConstvalueType)valueTypeMaybeis present. - operator[]:
at :: distanceType ->; ifTRefvalueTypevalueTypeMaybeis present andmutableisMutable.