3#ifndef AWKWARDPY_VIRTUAL_H_
4#define AWKWARDPY_VIRTUAL_H_
6#include <pybind11/pybind11.h>
11namespace py = pybind11;
21 const py::tuple&
args,
37 caches(std::vector<ak::ArrayCachePtr>& out)
const override;
41 const std::string& pre,
42 const std::string& post)
const override;
44 const std::shared_ptr<ak::ArrayGenerator>
47 const std::shared_ptr<ak::ArrayGenerator>
50 const std::shared_ptr<ak::ArrayGenerator>
53 const std::shared_ptr<ak::ArrayGenerator>
56 const std::shared_ptr<ak::ArrayGenerator>
59 const std::shared_ptr<ak::ArrayGenerator>
66 const py::object callable_;
67 const py::tuple args_;
68 const py::dict kwargs_;
71py::class_<PyArrayGenerator, std::shared_ptr<PyArrayGenerator>>
76py::class_<ak::SliceGenerator, std::shared_ptr<ak::SliceGenerator>>
89 get(
const std::string& key)
const override;
99 const std::string& pre,
100 const std::string& post)
const override;
103 const py::object mutablemapping_;
106py::class_<PyArrayCache, std::shared_ptr<PyArrayCache>>
void set(const std::string &key, const ak::ContentPtr &value) override
Writes or overwrites an array at key.
ak::ContentPtr get(const std::string &key) const override
Attempts to get an array; may be nullptr if not available.
const py::object mutablemapping() const
const std::string tostring_part(const std::string &indent, const std::string &pre, const std::string &post) const override
bool is_broken() const override
Returns true if the cache cannot be used for any reason.
PyArrayCache(const py::object &mutablemapping)
const std::shared_ptr< ak::ArrayGenerator > with_args(const py::tuple &args) const
const py::object callable() const
virtual bool referentially_equal(const ak::ArrayGeneratorPtr &other) const override
Returns true if this generator has all the same buffers and parameters as other; false otherwise.
const std::shared_ptr< ak::ArrayGenerator > with_kwargs(const py::dict &kwargs) const
PyArrayGenerator(const ak::FormPtr &form, int64_t length, const py::object &callable, const py::tuple &args, const py::dict &kwargs)
const std::shared_ptr< ak::ArrayGenerator > shallow_copy() const override
Copies this ArrayGenerator, referencing any contents.
void caches(std::vector< ak::ArrayCachePtr > &out) const override
Accumulates all the unique #ArrayCache objects from nested #VirtualArray nodes. (Uniqueness is determ...
const std::shared_ptr< ak::ArrayGenerator > with_length(int64_t length) const override
Return a copy of this ArrayGenerator with a different length (or a now-known length,...
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 py::tuple args() const
const std::shared_ptr< ak::ArrayGenerator > with_callable(const py::object &callable) const
const std::shared_ptr< ak::ArrayGenerator > with_form(const ak::FormPtr &form) const override
Return a copy of this ArrayGenerator with a different form (or a now-known form, whereas it might hav...
const py::dict kwargs() const
const ak::ContentPtr generate() const override
Creates an array but does not check it against the form.
Abstract superclass of cache for VirtualArray, defining the interface.
Definition: ArrayCache.h:17
Abstract superclass to generate arrays for VirtualArray, defining the interface.
Definition: ArrayGenerator.h:24
const FormPtr form() const
The Form the generated array is expected to take; may be nullptr.
int64_t length() const
The length the generated array is expected to have; may be negative to indicate that the length is un...
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
py::class_< PyArrayGenerator, std::shared_ptr< PyArrayGenerator > > make_PyArrayGenerator(const py::handle &m, const std::string &name)
py::class_< ak::SliceGenerator, std::shared_ptr< ak::SliceGenerator > > make_SliceGenerator(const py::handle &m, const std::string &name)
py::class_< PyArrayCache, std::shared_ptr< PyArrayCache > > make_PyArrayCache(const py::handle &m, const std::string &name)