26#ifndef PDI_DATATYPE_H_
27#define PDI_DATATYPE_H_
34#include <pdi/pdi_fwd.h>
35#include <pdi/datatype_template.h>
64 virtual bool operator== (
const Datatype& other )
const = 0;
71 bool operator!= (
const Datatype& other )
const;
140 virtual std::pair<void*, Datatype_sptr>
index (
size_t index,
void* data )
const;
157 virtual std::pair<void*, Datatype_sptr>
slice (
size_t start_index,
size_t end_index,
void* data )
const;
172 virtual std::pair<void*, Datatype_sptr>
member (
const char* name,
void* data )
const;
185 virtual std::pair<void*, Datatype_sptr>
dereference (
void* data )
const;
Definition: datatype_template.h:43
A Datatype is a Datatype_template that accepts no argument.
Definition: datatype.h:49
virtual void * data_to_dense_copy(void *to, const void *from) const =0
Creates a dense deep copy of data.
virtual bool dense() const =0
Indicate if the datatype is dense or not.
virtual size_t alignment() const =0
Returns the required alignment for a type.
virtual size_t buffersize() const =0
Computes the data size of a type, including potentially unused memory from a sparse type.
virtual Datatype_sptr slice(size_t start_index, size_t end_index) const
Access the type of the elements slice between the provided indices.
virtual std::pair< void *, Datatype_sptr > slice(size_t start_index, size_t end_index, void *data) const
Access the type and value of the elements slice between the provided indices.
virtual Datatype_sptr member(const char *name) const
Access the type of the member with the provided name.
virtual void destroy_data(void *ptr) const =0
Delete data whose type is described by the Datatype.
virtual void * data_from_dense_copy(void *to, const void *from) const =0
Creates a sparse deep copy of dense data.
Datatype(const Attributes_map &attributes={})
Creates a new datatype.
virtual std::pair< void *, Datatype_sptr > dereference(void *data) const
Access the type and value referenced by this.
virtual size_t datasize() const =0
Computes the data size of a type, excluding potentially unused memory from a sparse type.
virtual Datatype_sptr densify() const =0
Creates a new datatype as the dense copy of this one.
virtual Datatype_sptr dereference() const
Access the type referenced by this.
virtual Datatype_sptr index(size_t index) const
Access the type of the element at the provided index.
virtual bool simple() const =0
Tells if data can be copied as bytes (if type is dense) and doesn't need a destroyer.
virtual std::pair< void *, Datatype_sptr > member(const char *name, void *data) const
Access the type and value of the member with the provided name.
virtual std::pair< void *, Datatype_sptr > index(size_t index, void *data) const
Access the type and value of the element at the provided index.
virtual std::string debug_string() const =0
Returns the datatype yaml representation as a string.
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