Awkward Array: include/awkward/Iterator.h Source File

Loading...
Searching...
No Matches
Iterator.h
Go to the documentation of this file.
1// BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
2
3#ifndef AWKWARD_ITERATOR_H_
4#define AWKWARD_ITERATOR_H_
5
6#include "awkward/common.h"
7
8namespace awkward {
9 class Content;
10 using ContentPtr = std::shared_ptr<Content>;
11
20 class LIBAWKWARD_EXPORT_SYMBOL Iterator {
21 public:
25 Iterator(const ContentPtr& content);
26
28 const ContentPtr
29 content() const;
30
32 const int64_t
33 at() const;
34
38 const bool
39 isdone() const;
40
42 const ContentPtr
43 next();
44
51 const std::string
52 tostring_part(const std::string& indent,
53 const std::string& pre,
54 const std::string& post) const;
55
57 const std::string
58 tostring() const;
59
60 private:
62 const ContentPtr content_;
64 int64_t at_;
65 };
66}
67
68#endif // AWKWARD_ITERATOR_H_
awkward::Iterator
Represents the current state of iteration over a Content array.
Definition: Iterator.h:20
awkward::Iterator::tostring
const std::string tostring() const
Returns a string representation of this array (single-line XML).
awkward::Iterator::isdone
const bool isdone() const
If true, the Iterator has reached the end of the array and calling next again would raise an error....
awkward::Iterator::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.
awkward::Iterator::at
const int64_t at() const
The current position of the Iterator.
awkward::Iterator::Iterator
Iterator(const ContentPtr &content)
Creates an Iterator from a full set of parameters.
awkward::Iterator::next
const ContentPtr next()
Return the current item and then move the pointer to the next.
awkward::Iterator::content
const ContentPtr content() const
The array to iterate over.
common.h
LIBAWKWARD_EXPORT_SYMBOL
#define LIBAWKWARD_EXPORT_SYMBOL
Definition: common.h:45
awkward
Definition: BitMaskedArray.h:15
awkward::ContentPtr
std::shared_ptr< Content > ContentPtr
Definition: Content.h:15