| 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.
Instances
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 ->; ifrefT(constTvalueType)valueTypeMaybeis present. - operator*:
get :: this ->; ifrefTvalueTypevalueTypeMaybeis present andmutableisMutable. - *iter = x:
put :: this -> valueType ->; ifvoidTvalueTypeMaybeis 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 ->.refT(objTcls) - operator+:
plus :: this -> distanceType ->.toGcTcls - operator-=:
subtract :: distanceType ->.refT(objTcls) - operator-:
minus :: distanceType ->.toGcTcls - operator-:
difference :: this -> this -> distanceType. - operator[]:
atConst :: distanceType ->; ifrefT(constTvalueType)valueTypeMaybeis present. - operator[]:
at :: distanceType ->; ifrefTvalueTypevalueTypeMaybeis present andmutableisMutable.