26#ifndef PDI_ARRAY_DATATYPE_H_
27#define PDI_ARRAY_DATATYPE_H_
34#include <pdi/pdi_fwd.h>
35#include <pdi/datatype.h>
36#include <pdi/tuple_datatype.h>
47 struct Shared_enabler;
105 std::pair<void*, Datatype_sptr>
index(
size_t index,
void* data)
const override;
109 std::pair<void*, Datatype_sptr>
slice(
size_t start_index,
size_t end_index,
void* data)
const override;
125 static std::shared_ptr<Array_datatype>
153 Array_datatype(Datatype_sptr subtype,
size_t size,
const Attributes_map& attributes = {});
an Array_datatype is a Datatype that represents an array: i.e storage of multiple elements of the sam...
Definition: array_datatype.h:45
size_t datasize() const override
Computes the data size of a type, excluding potentially unused memory from a sparse type.
size_t size() const
Number of elements the array can store.
bool dense() const override
Indicate if the datatype is dense or not.
static std::shared_ptr< Array_datatype > make(Datatype_sptr subtype, size_t size, const Attributes_map &attributes={})
Construct a new completely filled Array_datatype.
std::pair< void *, Datatype_sptr > index(size_t index, void *data) const override
Access the type and value of the element at the provided index.
Datatype_sptr densify() const override
Creates a new datatype as the dense copy of this one.
Datatype_sptr evaluate(Context &) const override
Creates a new datatype by resolving the value of all metadata references.
Datatype_sptr index(size_t index) const override
Access the type of the element at the provided index.
void * data_from_dense_copy(void *, const void *) const override
Creates a sparse deep copy of dense data.
bool simple() const override
Tells if data can be copied as bytes (if type is dense) and doesn't need a destroyer.
static std::shared_ptr< Array_datatype > make(Datatype_sptr subtype, size_t size, size_t start, size_t subsize, const Attributes_map &attributes={})
Construct a new partially filled Array_datatype.
Datatype_sptr slice(size_t start_index, size_t end_index) const override
Access the type of the elements slice between the provided indices.
void * data_to_dense_copy(void *, const void *) const override
Creates a dense deep copy of data.
size_t subsize() const
Number of actual elements in the array.
void destroy_data(void *) const override
Delete data whose type is described by the Datatype.
size_t start() const
id of the first actual element of the array
size_t buffersize() const override
Computes the data size of a type, including potentially unused memory from a sparse type.
std::string debug_string() const override
Returns the datatype yaml representation as a string.
size_t alignment() const override
Returns the required alignment for a type.
std::pair< void *, Datatype_sptr > slice(size_t start_index, size_t end_index, void *data) const override
Access the type and value of the elements slice between the provided indices.
Datatype_sptr subtype() const
Type of the elements contained in the array.
A Datatype is a Datatype_template that accepts no argument.
Definition: datatype.h:47
Definition: array_datatype.h:38
std::unordered_map< std::string, Expression > Attributes_map
Definition: datatype_template.h:40
std::shared_ptr< const Datatype > Datatype_sptr
Definition: pdi_fwd.h:78