Qore Mapper Module Reference: Mapper::MapperIterator Class Reference

Qore Mapper Module Reference 1.0

- Main Page
- Related Pages
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Functions Variables Groups Pages
Public Member Functions | Private Attributes | List of all members
Mapper::MapperIterator Class Reference

provides a hash iterator based on a mapper object and an iterator input source More...

Inheritance diagram for Mapper::MapperIterator:
[legend]

## Public Member Functions
| constructor (Qore::AbstractIterator i, hash map, *hash opts)
| creates the iterator from the arguments passed More...
| constructor (Qore::AbstractIterator i, Mapper::Mapper map)
| creates the iterator from the arguments passed More...
int | getCount ()
| returns the internal record count More...
hash | getValue ()
| returns the current row transformed with the mapper
| resetCount ()
| resets the internal record count More...
Public Member Functions inherited from Mapper::AbstractMapperIterator
| constructor (Qore::AbstractIterator i)
| creates the iterator from the arguments passed More...
bool | next ()
| Moves the current position of the input iterator to the next element; returns False if there are no more elements.
bool | valid ()
| returns True if the input iterator is currently pointing at a valid element, False if not

## Private Attributes
Mapper::Mapper | map
| data mapper

## Detailed Description

provides a hash iterator based on a mapper object and an iterator input source

## Member Function Documentation

Mapper::MapperIterator::constructor | ( | Qore::AbstractIterator | i,
|  | hash | map,
|  | *hash | opts
| ) |  |

creates the iterator from the arguments passed

Parameters

  i | input iterator; AbstractIterator::getValue() must return a hash
  map | a hash providing field mappings; each hash key is the name of the output field; each value is either True (meaning no translations are done; the data is copied 1:1) or a hash describing the mapping; see Mapper Specification Format for detailed documnentation for this option
  opts | an optional hash of options for the mapper; see Mapper Options for a description of valid mapper options

Exceptions

  MAP-ERROR | the map hash has a logical error (ex: `"trunc"` key given without `"maxlen"`, invalid map key)

Mapper::MapperIterator::constructor | ( | Qore::AbstractIterator | i,
|  | Mapper::Mapper | map
| ) |  |

creates the iterator from the arguments passed

Parameters

  i | input iterator; AbstractIterator::getValue() must return a hash
  map | the mapper to transform the data

int Mapper::MapperIterator::getCount | ( |  | ) |

returns the internal record count

See Also
  resetCount()

Mapper::MapperIterator::resetCount | ( |  | ) |

resets the internal record count

See Also
  getCount()