Public Member Functions | |
Datatype_sptr | subtype () const |
Type of the pointed element. | |
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. | |
bool | dense () const override |
Indicate if the datatype is dense or not. | |
size_t | datasize () const override |
Computes the data size of a type, excluding potentially unused memory from a sparse type. | |
size_t | buffersize () const override |
Computes the data size of a type, including potentially unused memory from a sparse type. | |
size_t | alignment () const override |
Returns the required alignment for a type. | |
bool | simple () const override |
Tells if data can be copied as bytes (if type is dense) and doesn't need a destroyer. | |
void * | data_to_dense_copy (void *to, const void *from) const override |
Creates a dense deep copy of data. | |
void * | data_from_dense_copy (void *to, const void *from) const override |
Creates a sparse deep copy of dense data. | |
Datatype_sptr | index (size_t index) const override |
Access the type of the element at the provided index. | |
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 | slice (size_t start_index, size_t end_index) const override |
Access the type of the elements slice between the provided indices. | |
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 | member (const char *name) const override |
Access the type of the member with the provided name. | |
std::pair< void *, Datatype_sptr > | member (const char *name, void *data) const override |
Access the type and value of the member with the provided name. | |
Datatype_sptr | dereference () const override |
Access the type referenced by this. | |
std::pair< void *, Datatype_sptr > | dereference (void *data) const override |
Access the type and value referenced by this. | |
void | destroy_data (void *ptr) const override |
Delete data whose type is described by the Datatype. | |
std::string | debug_string () const override |
Returns the datatype yaml representation as a string. | |
bool | operator== (const Datatype &) const override |
Test for equality. | |
Public Member Functions inherited from PDI::Datatype | |
Datatype (const Attributes_map &attributes={}) | |
Creates a new datatype. | |
~Datatype () override | |
bool | operator!= (const Datatype &other) const |
Test for inequality. | |
Public Member Functions inherited from PDI::Datatype_template | |
Datatype_template (const Attributes_map &attributes={}) | |
Creates datatype template with given attributes. | |
Datatype_template (PC_tree_t datatype_tree) | |
Creates datatype template. | |
virtual | ~Datatype_template () |
Destroys the template. | |
Expression | attribute (const std::string &attribute_name) const |
Returns attribute of given name as Expression. | |
const Attributes_map & | attributes () const |
Returns all attributes as a unordered map. | |
Static Public Member Functions | |
static std::shared_ptr< Pointer_datatype > | make (Datatype_sptr subtype, const Attributes_map &attributes={}) |
Creates new pointer datatype. | |
static std::shared_ptr< Pointer_datatype > | make (Datatype_sptr subtype, std::function< void *(void *, const void *)> copy, std::function< void(void *)> destroy, const Attributes_map &attributes={}) |
Creates new pointer datatype. | |
Static Public Member Functions inherited from PDI::Datatype_template | |
static void | load_basic_datatypes (Context &ctx) |
Adds to the context the basic Array, Record, C and Fortran datatypes. | |
static void | load_user_datatypes (Context &ctx, PC_tree_t types_tree) |
Adds to the context the user defined datatypes. | |
Additional Inherited Members | |
Protected Attributes inherited from PDI::Datatype_template | |
Attributes_map | m_attributes |
Datatype_sptr PDI::Pointer_datatype::subtype | ( | ) | const |
Type of the pointed element.
|
overridevirtual |
Creates a new datatype as the dense copy of this one.
Implements PDI::Datatype.
|
overridevirtual |
Creates a new datatype by resolving the value of all metadata references.
ctx | the context in which to evaluate this template |
Implements PDI::Datatype_template.
|
overridevirtual |
Indicate if the datatype is dense or not.
Implements PDI::Datatype.
|
overridevirtual |
Computes the data size of a type, excluding potentially unused memory from a sparse type.
Implements PDI::Datatype.
|
overridevirtual |
Computes the data size of a type, including potentially unused memory from a sparse type.
Implements PDI::Datatype.
|
overridevirtual |
|
overridevirtual |
Tells if data can be copied as bytes (if type is dense) and doesn't need a destroyer.
Implements PDI::Datatype.
|
overridevirtual |
Creates a dense deep copy of data.
[in] | to | the pointer to the allocated memory to fill (dense data) |
[in] | from | the pointer to the copied data (size of buffersize) |
Implements PDI::Datatype.
|
overridevirtual |
Creates a sparse deep copy of dense data.
[in] | to | the pointer to the allocated memory to fill (size of buffersize) |
[in] | from | the pointer to the copied data (dense data) |
Implements PDI::Datatype.
|
overridevirtual |
Access the type of the element at the provided index.
index | the index where to look |
Reimplemented from PDI::Datatype.
|
overridevirtual |
Access the type and value of the element at the provided index.
index | the index where to look |
data | the address of the element to index |
Reimplemented from PDI::Datatype.
|
overridevirtual |
Access the type of the elements slice between the provided indices.
start_index | the index where to start |
end_index | the index where to end |
Reimplemented from PDI::Datatype.
|
overridevirtual |
Access the type and value of the elements slice between the provided indices.
start_index | the index where to start |
end_index | the index where to end |
data | the address of the element to slice |
Reimplemented from PDI::Datatype.
|
overridevirtual |
Access the type of the member with the provided name.
name | the name of the member to access |
Reimplemented from PDI::Datatype.
|
overridevirtual |
Access the type and value of the member with the provided name.
name | the name of the member to access |
data | the address of the element whose member to access |
Reimplemented from PDI::Datatype.
|
overridevirtual |
Access the type referenced by this.
Reimplemented from PDI::Datatype.
|
overridevirtual |
Access the type and value referenced by this.
data | the address of the reference |
Reimplemented from PDI::Datatype.
|
overridevirtual |
Delete data whose type is described by the Datatype.
This does not deallocate the buffer used to store the data.
[in] | ptr | to the data to free |
Implements PDI::Datatype.
|
overridevirtual |
Returns the datatype yaml representation as a string.
Implements PDI::Datatype.
|
overridevirtual |
Test for equality.
other | the Datatype to compare |
Implements PDI::Datatype.
|
static |
Creates new pointer datatype.
[in] | subtype | subtype of the pointer datatype |
[in] | attributes | attributes of the pointer datatype |
|
static |
Creates new pointer datatype.
[in] | subtype | subtype of the pointer datatype |
[in] | copy | function that copies data of this datatype |
[in] | destroy | function that destroys data of this datatype (doesn't deallocate memory) |
[in] | attributes | attributes of the pointer datatype |