A sequence of SliceItem objects representing a tuple passed to Python's __getitem__
.
More...
#include <Slice.h>
Public Member Functions | |
Slice (const std::vector< SliceItemPtr > &items, bool sealed) | |
Creates a Slice with a full set of parameters. More... | |
Slice (const std::vector< SliceItemPtr > &items) | |
Creates an "unsealed" Slice, to which we can still add SliceItem objects (with append). More... | |
Slice () | |
Creates an empty Slice. More... | |
const std::vector< SliceItemPtr > | items () const |
The SliceItem objects in this Slice. More... | |
bool | sealed () const |
If true , the Slice is immutable and append will fail. Otherwise, the items may be appended to. More... | |
int64_t | length () const |
The number of SliceItem objects in items. More... | |
int64_t | dimlength () const |
The number of SliceAt, SliceRange, and SliceArrayOf objects in the items. More... | |
const SliceItemPtr | head () const |
Returns a pointer to the first SliceItem. More... | |
const Slice | tail () const |
Returns a Slice representing all but the first SliceItem. More... | |
const Slice | only_fields () const |
Returns a Slice containing only SliceField and SliceFields. More... | |
const Slice | not_fields () const |
Returns a Slice without any SliceField or SliceFields. More... | |
const std::string | tostring () const |
Returns a string representation of this slice item (single-line custom format). More... | |
const Slice | prepended (const SliceItemPtr &item) const |
Returns a new Slice with item prepended. More... | |
void | append (const SliceItemPtr &item) |
Inserts a SliceItem in-place at the end of the items. More... | |
void | append (const SliceAt &item) |
Inserts a SliceAt in-place at the end of the items. More... | |
void | append (const SliceRange &item) |
Inserts a SliceRange in-place at the end of the items. More... | |
void | append (const SliceEllipsis &item) |
Inserts a SliceEllipsis in-place at the end of the items. More... | |
void | append (const SliceNewAxis &item) |
Inserts a SliceNewAxis in-place at the end of the items. More... | |
void | append (const SliceArray64 &item) |
Inserts a SliceArray64 in-place at the end of the items. More... | |
void | append (const SliceField &item) |
Inserts a SliceField in-place at the end of the items. More... | |
void | append (const SliceFields &item) |
Inserts a SliceFields in-place at the end of the items. More... | |
void | append (const SliceMissing64 &item) |
Inserts a SliceMissing64 in-place at the end of the items. More... | |
void | append (const SliceJagged64 &item) |
Inserts a SliceJagged64 in-place at the end of the items. More... | |
void | become_sealed () |
Seal this Slice so that it is no longer open to append. More... | |
bool | isadvanced () const |
Returns true if the Slice contains SliceArrayOf; false otherwise. More... | |
bool | referentially_equal (const Slice &other) const |
Returns true if this slice has all the same buffers and parameters as other ; false otherwise. More... | |
Static Public Member Functions | |
static int64_t | none () |
Represents a missing start , stop , or step in a SliceRange. More... | |
A sequence of SliceItem objects representing a tuple passed to Python's __getitem__
.
Slice | ( | const std::vector< SliceItemPtr > & | items, |
bool | sealed | ||
) |
Slice | ( | const std::vector< SliceItemPtr > & | items | ) |
void append | ( | const SliceArray64 & | item | ) |
Inserts a SliceArray64
in-place at the end of the items.
void append | ( | const SliceEllipsis & | item | ) |
Inserts a SliceEllipsis in-place at the end of the items.
void append | ( | const SliceField & | item | ) |
Inserts a SliceField in-place at the end of the items.
void append | ( | const SliceFields & | item | ) |
Inserts a SliceFields in-place at the end of the items.
void append | ( | const SliceItemPtr & | item | ) |
void append | ( | const SliceJagged64 & | item | ) |
Inserts a SliceJagged64
in-place at the end of the items.
void append | ( | const SliceMissing64 & | item | ) |
Inserts a SliceMissing64
in-place at the end of the items.
void append | ( | const SliceNewAxis & | item | ) |
Inserts a SliceNewAxis in-place at the end of the items.
void append | ( | const SliceRange & | item | ) |
Inserts a SliceRange in-place at the end of the items.
int64_t dimlength | ( | ) | const |
The number of SliceAt, SliceRange, and SliceArrayOf objects in the items.
const SliceItemPtr head | ( | ) | const |
Returns a pointer to the first SliceItem.
bool isadvanced | ( | ) | const |
Returns true
if the Slice contains SliceArrayOf; false
otherwise.
This function can only be called when the Slice is sealed (see Slice and become_sealed).
const std::vector< SliceItemPtr > items | ( | ) | const |
|
static |
Represents a missing start
, stop
, or step
in a SliceRange.
const Slice not_fields | ( | ) | const |
Returns a Slice without any SliceField or SliceFields.
const Slice only_fields | ( | ) | const |
Returns a Slice containing only SliceField and SliceFields.
const Slice prepended | ( | const SliceItemPtr & | item | ) | const |
Returns a new Slice with item
prepended.
bool referentially_equal | ( | const Slice & | other | ) | const |
Returns true
if this slice has all the same buffers and parameters as other
; false
otherwise.
other | The slice to compare this with. |
bool sealed | ( | ) | const |
const std::string tostring | ( | ) | const |
Returns a string representation of this slice item (single-line custom format).