|
HL-HDF
|
Functions for working with HL_Node's. More...
#include "hlhdf.h"#include "hlhdf_alloc.h"#include "hlhdf_private.h"#include "hlhdf_defines_private.h"#include "hlhdf_node_private.h"#include "hlhdf_debug.h"#include <string.h>#include <stdlib.h>Classes | |
| struct | _HL_Node |
| Represents a HDF5 object/attribute/reference/... More... | |
Functions | |
| void | HLNodePrivate_setData (HL_Node *node, size_t datasize, unsigned char *data) |
| Sets data and datasize in the node. | |
| void | HLNodePrivate_setRawdata (HL_Node *node, size_t datasize, unsigned char *data) |
| Sets rawdata and rawdatasize in the node. | |
| int | HLNodePrivate_setTypeIdAndDeriveFormat (HL_Node *node, hid_t type) |
| Copies the typid and sets it in the node and also atempts to derive the format name. | |
| void | HLNodePrivate_setHdfID (HL_Node *node, hid_t hdfid) |
| Sets the HDF identifier. | |
| hid_t | HLNodePrivate_getHdfID (HL_Node *node) |
| Returns the HDF identifier. | |
| const hsize_t * | HLNodePrivate_getDims (HL_Node *node) |
| Returns an internal pointer to the dimensions. | |
| hid_t | HLNodePrivate_getTypeId (HL_Node *node) |
| Returns the internal type id. | |
| HL_Node * | HLNode_new (const char *name) |
| Creates a new HL_Node instance. | |
| void | HLNode_free (HL_Node *node) |
| Deallocates the provided node. | |
| HL_Node * | HLNode_newGroup (const char *name) |
| Creates an empty group HL_Node of type HL_Type::GROUP_ID. | |
| HL_Node * | HLNode_newAttribute (const char *name) |
| Creates an empty attribute HL_Node of type HL_Type::ATTRIBUTE_ID. | |
| HL_Node * | HLNode_newDataset (const char *name) |
| Creates an empty data set HL_Node of type HL_Type::DATASET_ID. | |
| HL_Node * | HLNode_newDatatype (const char *name) |
| Creates an empty data type HL_Node of type HL_Type::TYPE_ID. | |
| HL_Node * | HLNode_newReference (const char *name) |
| Creates an empty reference HL_Node of type HL_Type::REFERENCE_ID. | |
| HL_Node * | HLNode_copy (HL_Node *node) |
| Copies an HL_Node. | |
| int | HLNode_setScalarValue (HL_Node *node, size_t sz, unsigned char *value, const char *fmt, hid_t typid) |
| Sets a scalar value in the specified node. | |
| int | HLNode_setArrayValue (HL_Node *node, size_t sz, int ndims, hsize_t *dims, unsigned char *value, const char *fmt, hid_t typid) |
| Sets an array value in the specified node. | |
| const char * | HLNode_getName (HL_Node *node) |
| Returns the node name. | |
| unsigned char * | HLNode_getData (HL_Node *node) |
| Returns the internal data pointer for this node. | |
| size_t | HLNode_getDataSize (HL_Node *node) |
| Returns the type size for the data format. | |
| unsigned char * | HLNode_getRawdata (HL_Node *node) |
| Returns the internal rawdata pointer for this node. | |
| size_t | HLNode_getRawdataSize (HL_Node *node) |
| Returns the type size for the raw data format. | |
| int | HLNode_nameEquals (HL_Node *node, const char *name) |
| Compares the nodes name with the provided name. | |
| void | HLNode_setMark (HL_Node *node, const HL_NodeMark mark) |
| Marks a node. | |
| HL_NodeMark | HLNode_getMark (HL_Node *node) |
| Returns the mark of a node. | |
| int | HLNode_fetched (HL_Node *node) |
| Returns if the data for this node has been extracted from the hdf5 file or not. | |
| void | HLNode_setFetched (HL_Node *node, int fetched) |
| Sets if this node has got its data fetched or not. | |
| HL_Type | HLNode_getType (HL_Node *node) |
| Gets the type of the node. | |
| const char * | HLNode_getFormatName (HL_Node *node) |
| Gets the string represenation of the data format. | |
| HL_FormatSpecifier | HLNode_getFormat (HL_Node *node) |
| Returns the format specifier for the node. | |
| void | HLNode_setDataType (HL_Node *node, HL_DataType datatype) |
| Sets the data type of the node. | |
| HL_DataType | HLNode_getDataType (HL_Node *node) |
| Returns the data type of the node. | |
| int | HLNode_setDimensions (HL_Node *node, int ndims, hsize_t *dims) |
| Sets the node dimensions. | |
| void | HLNode_getDimensions (HL_Node *node, int *ndims, hsize_t **dims) |
| Gets the node dimensions. | |
| int | HLNode_getRank (HL_Node *node) |
| Returns the rank (number of dimensions). | |
| hsize_t | HLNode_getDimension (HL_Node *node, int index) |
| Returns the dimension of the specified index. | |
| hsize_t | HLNode_getNumberOfPoints (HL_Node *node) |
| Returns the number of value points that this node has. | |
| void | HLNode_setCompoundDescription (HL_Node *node, HL_CompoundTypeDescription *descr) |
| Sets the description for this node. | |
| HL_CompoundTypeDescription * | HLNode_getCompoundDescription (HL_Node *node) |
| Returns the compound description for the node (if any). | |
| HL_Compression * | HLNode_getCompression (HL_Node *node) |
| Returns the compression object for this node. | |
| void | HLNode_setCompression (HL_Node *node, HL_Compression *compression) |
| Sets the compression object for this node. | |
| int | HLNode_commitType (HL_Node *node, hid_t thid) |
| Will mark the node to be committed, only applicable on type nodes. | |
Functions for working with HL_Node's.
| int HLNode_fetched | ( | HL_Node * | node | ) |
Returns if the data for this node has been extracted from the hdf5 file or not.
Useful if implementing for example lazy-loading or similar features.
| [in] | node | - the node |
| HL_CompoundTypeDescription * HLNode_getCompoundDescription | ( | HL_Node * | node | ) |
Returns the compound description for the node (if any).
| [in] | node | the node |
| HL_Compression * HLNode_getCompression | ( | HL_Node * | node | ) |
Returns the compression object for this node.
| [in] | node | the node |
| unsigned char * HLNode_getData | ( | HL_Node * | node | ) |
Returns the internal data pointer for this node.
| [in] | node | the node |
| size_t HLNode_getDataSize | ( | HL_Node * | node | ) |
Returns the type size for the data format.
| [in] | node | the node |
| HL_DataType HLNode_getDataType | ( | HL_Node * | node | ) |
Returns the data type of the node.
| [in] | node | the node |
| hsize_t HLNode_getDimension | ( | HL_Node * | node, |
| int | index ) |
Returns the dimension of the specified index.
| [in] | node | the node |
| [in] | index | the index |
| void HLNode_getDimensions | ( | HL_Node * | node, |
| int * | ndims, | ||
| hsize_t ** | dims ) |
Gets the node dimensions.
| [in] | node | the node |
| [out] | ndims | the rank |
| [out] | dims | the dimensions |
| HL_FormatSpecifier HLNode_getFormat | ( | HL_Node * | node | ) |
Returns the format specifier for the node.
| [in] | node | the node |
| const char * HLNode_getFormatName | ( | HL_Node * | node | ) |
Gets the string represenation of the data format.
| [in] | node | the node |
| HL_NodeMark HLNode_getMark | ( | HL_Node * | node | ) |
Returns the mark of a node.
| [in] | node | - the node |
| const char * HLNode_getName | ( | HL_Node * | node | ) |
Returns the node name.
| [in] | node | the node |
| hsize_t HLNode_getNumberOfPoints | ( | HL_Node * | node | ) |
Returns the number of value points that this node has.
If rank == 0, then 1 is returned. If rank > 0 and dims is set, then 1*dims[0]*...*dims[rank-1] is returned. If rank > 0 and dims == NULL, which not should happen, but then 0 is returned
| [in] | node | the node |
| int HLNode_getRank | ( | HL_Node * | node | ) |
Returns the rank (number of dimensions).
| [in] | node | the node |
| unsigned char * HLNode_getRawdata | ( | HL_Node * | node | ) |
Returns the internal rawdata pointer for this node.
| [in] | node | the node |
| size_t HLNode_getRawdataSize | ( | HL_Node * | node | ) |
Returns the type size for the raw data format.
| [in] | node | the node |
Gets the type of the node.
| [in] | node | the node |
| int HLNode_nameEquals | ( | HL_Node * | node, |
| const char * | name ) |
Compares the nodes name with the provided name.
| [in] | node | the node |
| [in] | name | the name to test |
| void HLNode_setCompoundDescription | ( | HL_Node * | node, |
| HL_CompoundTypeDescription * | descr ) |
Sets the description for this node.
| [in] | node | the node |
| [in] | descr | the compound description (memory taken over so do not release it) |
| void HLNode_setCompression | ( | HL_Node * | node, |
| HL_Compression * | compression ) |
Sets the compression object for this node.
| [in] | node | the node |
| [in] | compression | the compression object (HL_Node takes responsibility so do not free after call). |
| void HLNode_setDataType | ( | HL_Node * | node, |
| HL_DataType | datatype ) |
Sets the data type of the node.
| [in] | node | the node |
| [in] | datatype | the datatype |
| int HLNode_setDimensions | ( | HL_Node * | node, |
| int | ndims, | ||
| hsize_t * | dims ) |
Sets the node dimensions.
| [in] | node | the node |
| [in] | ndims | the rank |
| [in] | dims | the dimensions |
| void HLNode_setFetched | ( | HL_Node * | node, |
| int | fetched ) |
Sets if this node has got its data fetched or not.
| [in] | node | - the node |
| [in] | fetched | - 1 if data fetched, otherwise 0 |
| void HLNode_setMark | ( | HL_Node * | node, |
| const HL_NodeMark | mark ) |
Marks a node.
| [in] | node | - the node |
| [in] | mark | - the node mark |
| const hsize_t * HLNodePrivate_getDims | ( | HL_Node * | node | ) |
Returns an internal pointer to the dimensions.
| [in] | node | the node |
| hid_t HLNodePrivate_getHdfID | ( | HL_Node * | node | ) |
Returns the HDF identifier.
| [in] | node | the node |
| hid_t HLNodePrivate_getTypeId | ( | HL_Node * | node | ) |
Returns the internal type id.
| [in] | node | the node |
| void HLNodePrivate_setData | ( | HL_Node * | node, |
| size_t | datasize, | ||
| unsigned char * | data ) |
Sets data and datasize in the node.
When this function has been called, responsibility for the data has been taken over so do not release that memory.
| [in] | node | the node (MAY NOT BE NULL) |
| [in] | datasize | the size of the data type as get by H5Tget_size. |
| [in] | data | the data (responsibility taken over so do not release after call). |
| void HLNodePrivate_setHdfID | ( | HL_Node * | node, |
| hid_t | hdfid ) |
Sets the HDF identifier.
| [in] | node | the node |
| [in] | hdfid | the hdf id. (The responsibility is taken over so do not delete) |
| void HLNodePrivate_setRawdata | ( | HL_Node * | node, |
| size_t | datasize, | ||
| unsigned char * | data ) |
Sets rawdata and rawdatasize in the node.
When this function has been called, responsibility for the data has been taken over so do not release that memory.
| [in] | node | the node (MAY NOT BE NULL) |
| [in] | datasize | the size of the data type as get by H5Tget_size. |
| [in] | data | the data (responsibility taken over so do not release after call). |
| int HLNodePrivate_setTypeIdAndDeriveFormat | ( | HL_Node * | node, |
| hid_t | typid ) |
Copies the typid and sets it in the node and also atempts to derive the format name.
| [in] | node | the node |
| [in] | typid | the type identifier |