3#ifndef AWKWARD_ARRAYGENERATOR_H_
4#define AWKWARD_ARRAYGENERATOR_H_
65 caches(std::vector<ArrayCachePtr>& out)
const = 0;
68 virtual const std::string
70 const std::string& pre,
71 const std::string& post)
const = 0;
74 virtual const std::shared_ptr<ArrayGenerator>
79 virtual const std::shared_ptr<ArrayGenerator>
84 virtual const std::shared_ptr<ArrayGenerator>
124 caches(std::vector<ArrayCachePtr>& out)
const override;
128 const std::string& pre,
129 const std::string& post)
const override;
131 const std::shared_ptr<ArrayGenerator>
134 const std::shared_ptr<ArrayGenerator>
137 const std::shared_ptr<ArrayGenerator>
Abstract superclass to generate arrays for VirtualArray, defining the interface.
Definition: ArrayGenerator.h:24
virtual const std::shared_ptr< ArrayGenerator > with_form(const FormPtr &form) const =0
Return a copy of this ArrayGenerator with a different form (or a now-known form, whereas it might hav...
virtual const std::shared_ptr< ArrayGenerator > with_length(int64_t length) const =0
Return a copy of this ArrayGenerator with a different length (or a now-known length,...
const FormPtr form_
Definition: ArrayGenerator.h:95
ArrayGenerator(const FormPtr &form, int64_t length)
Called by subclasses to set the form of an ArrayGenerator.
int64_t length_
Definition: ArrayGenerator.h:97
virtual void caches(std::vector< ArrayCachePtr > &out) const =0
Accumulates all the unique #ArrayCache objects from nested #VirtualArray nodes. (Uniqueness is determ...
virtual const std::string tostring_part(const std::string &indent, const std::string &pre, const std::string &post) const =0
Returns a string representation of this ArrayGenerator.
virtual const ContentPtr generate() const =0
Creates an array but does not check it against the form.
const FormPtr form() const
The Form the generated array is expected to take; may be nullptr.
virtual ~ArrayGenerator()
Virtual destructor acts as a first non-inline virtual function that determines a specific translation...
int64_t length() const
The length the generated array is expected to have; may be negative to indicate that the length is un...
virtual const std::shared_ptr< ArrayGenerator > shallow_copy() const =0
Copies this ArrayGenerator, referencing any contents.
const ContentPtr generate_and_check()
Creates an array and checks it against the form. If form was not available initially,...
virtual bool referentially_equal(const ArrayGeneratorPtr &other) const =0
Returns true if this generator has all the same buffers and parameters as other; false otherwise.
Generator for lazy slicing. Used to avoid materializing a VirtualArray before its content is needed (...
Definition: ArrayGenerator.h:107
void caches(std::vector< ArrayCachePtr > &out) const override
Accumulates all the unique #ArrayCache objects from nested #VirtualArray nodes. (Uniqueness is determ...
const std::shared_ptr< ArrayGenerator > with_form(const FormPtr &form) const override
Return a copy of this ArrayGenerator with a different form (or a now-known form, whereas it might hav...
const Slice slice_
Definition: ArrayGenerator.h:145
virtual bool referentially_equal(const ArrayGeneratorPtr &other) const override
Returns true if this generator has all the same buffers and parameters as other; false otherwise.
SliceGenerator(const FormPtr &form, int64_t length, const ContentPtr &content, const Slice &slice)
const ContentPtr content_
Definition: ArrayGenerator.h:144
const std::string tostring_part(const std::string &indent, const std::string &pre, const std::string &post) const override
Returns a string representation of this ArrayGenerator.
const ContentPtr generate() const override
Creates an array but does not check it against the form.
const std::shared_ptr< ArrayGenerator > with_length(int64_t length) const override
Return a copy of this ArrayGenerator with a different length (or a now-known length,...
const Slice slice() const
const ContentPtr content() const
const std::shared_ptr< ArrayGenerator > shallow_copy() const override
Copies this ArrayGenerator, referencing any contents.
A sequence of SliceItem objects representing a tuple passed to Python's __getitem__.
Definition: Slice.h:585
#define LIBAWKWARD_EXPORT_SYMBOL
Definition: common.h:45
Definition: BitMaskedArray.h:15
std::shared_ptr< ArrayGenerator > ArrayGeneratorPtr
Definition: ArrayGenerator.h:14
std::shared_ptr< Content > ContentPtr
Definition: Content.h:15
std::shared_ptr< Form > FormPtr
Definition: Content.h:18