Awkward Array: Iterator Class Reference

Loading...
Searching...
No Matches
Public Member Functions | List of all members
Iterator Class Reference

Represents the current state of iteration over a Content array. More...

`#include <Iterator.h>`

## Public Member Functions
| Iterator (const ContentPtr &content)
| Creates an Iterator from a full set of parameters. More...
const ContentPtr | content () const
| The array to iterate over. More...
const int64_t | at () const
| The current position of the Iterator. More...
const bool | isdone () const
| If `true`, the Iterator has reached the end of the array and calling next again would raise an error. If `false`, the Iterator can still be moved forward. More...
const ContentPtr | next ()
| Return the current item and then move the pointer to the next. More...
const std::string | tostring_part (const std::string &indent, const std::string &pre, const std::string &post) const
| Internal function to build an output string for tostring. More...
const std::string | tostring () const
| Returns a string representation of this array (single-line XML). More...

## Detailed Description

Represents the current state of iteration over a Content array.

An Iterator is characterized by its content (an input parameter) and where it is at (in-place mutable integer).

It can only be modified by calling next.

## Constructor & Destructor Documentation

## ◆ Iterator()

Iterator | ( | const ContentPtr & | content | ) |

Creates an Iterator from a full set of parameters.

Parameters

  content | The array to iterate over.

## Member Function Documentation

## ◆ at()

const int64_t at | ( |  | ) | const

The current position of the Iterator.

## ◆ content()

const ContentPtr content | ( |  | ) | const

The array to iterate over.

## ◆ isdone()

const bool isdone | ( |  | ) | const

If `true`, the Iterator has reached the end of the array and calling next again would raise an error. If `false`, the Iterator can still be moved forward.

## ◆ next()

const ContentPtr next | ( |  | ) |

Return the current item and then move the pointer to the next.

## ◆ tostring()

const std::string tostring | ( |  | ) | const

Returns a string representation of this array (single-line XML).

## ◆ tostring_part()

const std::string tostring_part | ( | const std::string & | indent,
|  | const std::string & | pre,
|  | const std::string & | post
| ) |  | const

Internal function to build an output string for tostring.

Parameters

  indent | Indentation depth as a string of spaces.
  pre | Prefix string, usually an opening XML tag.
  post | Postfix string, usually a closing XML tag and carriage return.

The documentation for this class was generated from the following file:

- include/awkward/Iterator.h