3#ifndef AWKWARD_IDENTITIES_H_
4#define AWKWARD_IDENTITIES_H_
63 using FieldLoc = std::vector<std::pair<int64_t, std::string>>;
131 virtual const std::string
135 virtual const std::string
148 virtual const std::string
150 const std::string& pre,
151 const std::string& post)
const = 0;
216 value(int64_t row, int64_t col)
const = 0;
290 template <
typename T>
292#ifdef AWKWARD_IDENTITIES_NO_EXTERN_TEMPLATE
316 const std::shared_ptr<T> ptr,
328 const std::shared_ptr<T>
349 const std::string& pre,
350 const std::string& post)
const override;
371 value(int64_t row, int64_t col)
const override;
408 const std::shared_ptr<T> ptr_;
413#ifndef AWKWARD_IDENTITIES_NO_EXTERN_TEMPLATE
A contiguous, two-dimensional array of integers and a list of strings used to represent a path from t...
Definition: Identities.h:295
const IdentitiesPtr deep_copy() const override
Copies this Identities node and all the data in its buffer.
const IdentitiesPtr withfieldloc(const FieldLoc &fieldloc) const override
Returns this Identities node with a different fieldloc.
T * data() const
Raw pointer to the beginning of data (i.e. offset accounted for).
const IdentitiesPtr shallow_copy() const override
Copies this Identities node without copying its buffer.
const std::vector< T > getitem_at(int64_t at) const
Returns the element at a given position in the array, handling negative indexing and bounds-checking ...
const std::string identity_at(int64_t at) const override
Return a string representing an identity tuple at where.
bool referentially_equal(const IdentitiesPtr &other) const override
Returns true if this Identities has all the same buffers and parameters as other; false otherwise.
const IdentitiesPtr copy_to(kernel::lib ptr_lib) const override
Moves the identity ptr buffer of the array between devices.
const IdentitiesPtr getitem_range(int64_t start, int64_t stop) const
Subinterval of this array, handling negative indexing and bounds-checking like Python.
void nbytes_part(std::map< size_t, int64_t > &largest) const override
Internal function used to calculate Content::nbytes.
const IdentitiesPtr to64() const override
Converts this Identities to an Identities64.
const IdentitiesPtr getitem_carry_64(const Index64 &carry) const override
Returns an Identities array with elements filtered, rearranged, and possibly duplicated by the carry ...
const std::shared_ptr< T > ptr() const
Reference-counted pointer to the array buffer.
const std::string tostring_part(const std::string &indent, const std::string &pre, const std::string &post) const override
Internal function to build an output string for tostring.
int64_t value(int64_t row, int64_t col) const override
Returns the integer value of the two-dimensional array at row and col.
const std::vector< T > getitem_at_nowrap(int64_t at) const
Returns the element at a given position in the array, without handling negative indexing or bounds-ch...
const IdentitiesPtr getitem_range_nowrap(int64_t start, int64_t stop) const override
Subinterval of this array, without handling negative indexing or bounds-checking.
kernel::lib ptr_lib() const override
The Kernel Library that ptr uses.
const std::string classname() const override
User-friendly name of this class: "Identities32" or "Identities64".
A contiguous, two-dimensional array of integers and a list of strings used to represent a path from t...
Definition: Identities.h:57
const std::string tostring() const
Returns a string representation of this array (multi-line XML).
Identities(const Ref ref, const FieldLoc &fieldloc, int64_t offset, int64_t width, int64_t length)
Called by all subclass constructors; assigns ref, fieldloc, offset, width, and length upon constructi...
int64_t width_
See width.
Definition: Identities.h:246
const int64_t length() const
The number of identities in the array.
const int64_t width() const
The number of integers in each identity tuple.
static IdentitiesPtr none()
A constant, empty Identities pointer (nullptr).
virtual const IdentitiesPtr to64() const =0
Converts this Identities to an Identities64.
virtual kernel::lib ptr_lib() const =0
The Kernel Library that ptr uses.
virtual const IdentitiesPtr getitem_carry_64(const Index64 &carry) const =0
Returns an Identities array with elements filtered, rearranged, and possibly duplicated by the carry ...
virtual ~Identities()
Virtual destructor acts as a first non-inline virtual function that determines a specific translation...
int64_t Ref
Identities reference type (64-bit integer).
Definition: Identities.h:60
virtual const std::string tostring_part(const std::string &indent, const std::string &pre, const std::string &post) const =0
Internal function to build an output string for tostring.
static Ref newref()
Returns a new Identities reference that is globally unique in the current process.
virtual const IdentitiesPtr copy_to(kernel::lib ptr_lib) const =0
Moves the identity ptr buffer of the array between devices.
const Ref ref() const
A globally unique reference to this set of identities.
virtual const IdentitiesPtr shallow_copy() const =0
Copies this Identities node without copying its buffer.
const int64_t offset() const
Location of item zero in the buffer, relative to ptr, measured in the number of elements....
virtual int64_t value(int64_t row, int64_t col) const =0
Returns the integer value of the two-dimensional array at row and col.
virtual const std::string classname() const =0
User-friendly name of this class: "Identities32" or "Identities64".
const FieldLoc fieldloc_
See fieldloc.
Definition: Identities.h:242
const FieldLoc fieldloc() const
A list of integer-string pairs indicating the positions of all tuple/record field indicators within t...
virtual const IdentitiesPtr deep_copy() const =0
Copies this Identities node and all the data in its buffer.
virtual void nbytes_part(std::map< size_t, int64_t > &largest) const =0
Internal function used to calculate Content::nbytes.
std::vector< std::pair< int64_t, std::string > > FieldLoc
Identities field location type (integer-string pairs).
Definition: Identities.h:63
int64_t offset_
See offset.
Definition: Identities.h:244
virtual const IdentitiesPtr getitem_range_nowrap(int64_t start, int64_t stop) const =0
Subinterval of this array, without handling negative indexing or bounds-checking.
virtual const std::string identity_at(int64_t where) const =0
Return a string representing an identity tuple at where.
const Ref ref_
See ref.
Definition: Identities.h:240
virtual const IdentitiesPtr withfieldloc(const FieldLoc &fieldloc) const =0
Returns this Identities node with a different fieldloc.
virtual bool referentially_equal(const IdentitiesPtr &other) const =0
Returns true if this Identities has all the same buffers and parameters as other; false otherwise.
A contiguous, one-dimensional array of integers used to represent data structures,...
Definition: Index.h:82
#define LIBAWKWARD_EXPORT_SYMBOL
Definition: common.h:45
lib
Definition: kernel-dispatch.h:20
Definition: BitMaskedArray.h:15
std::shared_ptr< Identities > IdentitiesPtr
Definition: Identities.h:16