hoppy-std-0.5.0: C++ FFI generator - Standard library bindings

Safe HaskellNone
LanguageHaskell2010

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.

Synopsis

Documentation

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, and Equatable.
  • operator*: getConst :: this -> refT (constT valueType); if valueTypeMaybe is present.
  • operator*: get :: this -> refT valueType; if valueTypeMaybe is present and mutable is Mutable.
  • *iter = x: put :: this -> valueType -> voidT; if valueTypeMaybe is present and mutable is Mutable.

makeForwardIterator :: IteratorMutability -> Maybe Type -> Class -> Class Source #

Turns a class into a forward iterator, including everything from makeTrivialIterator plus the pre-increment operator:

  • operator++: next :: this -> refT (objT cls).

makeBidirectionalIterator :: IteratorMutability -> Maybe Type -> Class -> Class Source #

Turns a class into a bidirectional iterator, including everything from makeForwardIterator plus the pre-decrement operator:

  • operator--: prev :: this -> refT (objT cls).

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 (objT cls).
  • operator+: plus :: this -> distanceType -> toGcT cls.
  • operator-=: subtract :: distanceType -> refT (objT cls).
  • operator-: minus :: distanceType -> toGcT cls.
  • operator-: difference :: this -> this -> distanceType.
  • operator[]: atConst :: distanceType -> refT (constT valueType); if valueTypeMaybe is present.
  • operator[]: at :: distanceType -> refT valueType; if valueTypeMaybe is present and mutable is Mutable.