3#ifndef AWKWARD_INDEX_H_
4#define AWKWARD_INDEX_H_
34 enum class Form {i8, u8, i32, u32, i64, kNumIndexForm};
41 static const std::string
52 virtual const std::shared_ptr<Index>
61 iscontiguous()
const = 0;
79#ifdef AWKWARD_INDEX_NO_EXTERN_TEMPLATE
111 const std::shared_ptr<T>
152 const std::string& pre,
153 const std::string& post)
const;
214 const std::shared_ptr<Index>
237 const std::shared_ptr<T> ptr_;
241 const int64_t offset_;
243 const int64_t length_;
244 bool is_empty_advanced_;
247#ifndef AWKWARD_INDEX_NO_EXTERN_TEMPLATE
A contiguous, one-dimensional array of integers used to represent data structures,...
Definition: Index.h:82
void setitem_at_nowrap(int64_t at, T value) const
Assigns an integer value (type T) in-place.
void nbytes_part(std::map< size_t, int64_t > &largest) const
Internal function used to calculate Content::nbytes.
const std::string tostring() const
Returns a string representation of this array (single-line XML).
T * data() const
Raw pointer to the beginning of data (i.e. offset accounted for).
IndexOf< T > getitem_range(int64_t start, int64_t stop) const
Subinterval of this array, handling negative indexing and bounds-checking like Python.
const std::shared_ptr< Index > shallow_copy() const override
Copies this Index node without copying its buffer.
bool referentially_equal(const IndexOf< T > &other) const
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 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.
static IndexOf< T > empty_advanced()
Create a zero-length index representing an empty 'advanced' index.
bool iscontiguous() const override
Returns true if this index is contiguous false otherwise.
const std::string classname() const
User-friendly name of this class: "Index8", "IndexU8", "Index32", "IndexU32", or "Index64".
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::shared_ptr< T > ptr() const
Reference-counted pointer to the integer array buffer.
IndexOf< T > getitem_range_nowrap(int64_t start, int64_t stop) const
Subinterval of this array, without handling negative indexing or bounds-checking.
int64_t offset() const
Location of item zero in the buffer, relative to ptr, measured in the number of elements.
const IndexOf< T > copy_to(kernel::lib ptr_lib) const
kernel::lib ptr_lib() const
The Kernel Library that ptr uses.
const IndexOf< T > deep_copy() const
Copies this Index node and all the data in its buffer.
int64_t length() const
Number of elements in the array.
Form form() const
Returns the enum describing this Index's integer specialization.
bool is_empty_advanced() const
Returns true if this is an empty 'advanced' index.
IndexOf< int64_t > to64() const override
Converts this Index to an Index64.
A contiguous, one-dimensional array of integers used to represent data structures,...
Definition: Index.h:31
virtual const std::shared_ptr< Index > shallow_copy() const =0
Copies this Index node without copying its buffer.
static const std::string form2str(Form form)
Converts a Form enumeration into a string.
static Form str2form(const std::string &str)
Converts a string into a Form enumeration.
Form
Integer type of an Index, used by ListForm, IndexedForm, etc.
Definition: Index.h:34
virtual IndexOf< int64_t > to64() const =0
Converts this Index to an Index64.
virtual ~Index()
Virtual destructor acts as a first non-inline virtual function that determines a specific translation...
#define LIBAWKWARD_EXPORT_SYMBOL
Definition: common.h:45
lib
Definition: kernel-dispatch.h:20
Definition: BitMaskedArray.h:15