HL-HDF
hlhdf_node.h
Go to the documentation of this file.
1/* --------------------------------------------------------------------
2Copyright (C) 2009 Swedish Meteorological and Hydrological Institute, SMHI,
3
4This file is part of HLHDF.
5
6HLHDF is free software: you can redistribute it and/or modify
7it under the terms of the GNU Lesser General Public License as published by
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
10
11HLHDF is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU Lesser General Public License for more details.
15
16You should have received a copy of the GNU Lesser General Public License
17along with HLHDF. If not, see <http://www.gnu.org/licenses/>.
18------------------------------------------------------------------------*/
19
26#ifndef HLHDF_NODE_H
27#define HLHDF_NODE_H
28#include "hlhdf_types.h"
29
36HL_Node* HLNode_new(const char* name);
37
43void HLNode_free(HL_Node* node);
44
51HL_Node* HLNode_newGroup(const char* name);
52
59HL_Node* HLNode_newAttribute(const char* name);
60
67HL_Node* HLNode_newDataset(const char* name);
68
75HL_Node* HLNode_newDatatype(const char* name);
76
83HL_Node* HLNode_newReference(const char* name);
84
92
103int HLNode_setScalarValue(HL_Node* node,size_t sz,unsigned char* value,const char* fmt,hid_t typid);
104
117int HLNode_setArrayValue(HL_Node* node,size_t sz,int ndims,hsize_t* dims,unsigned char* value,
118 const char* fmt,hid_t typid);
119
125const char* HLNode_getName(HL_Node* node);
126
132unsigned char* HLNode_getData(HL_Node* node);
133
139size_t HLNode_getDataSize(HL_Node* node);
140
146unsigned char* HLNode_getRawdata(HL_Node* node);
147
153size_t HLNode_getRawdataSize(HL_Node* node);
154
161int HLNode_nameEquals(HL_Node* node, const char* name);
162
168void HLNode_setMark(HL_Node* node, const HL_NodeMark mark);
169
176
183int HLNode_fetched(HL_Node* node);
184
190void HLNode_setFetched(HL_Node* node, int fetched);
191
192
199
205const char* HLNode_getFormatName(HL_Node* node);
206
213
220void HLNode_setDataType(HL_Node* node, HL_DataType datatype);
221
228
236int HLNode_setDimensions(HL_Node* node, int ndims, hsize_t* dims);
237
244void HLNode_getDimensions(HL_Node* node, int* ndims, hsize_t** dims);
245
251int HLNode_getRank(HL_Node* node);
252
259hsize_t HLNode_getDimension(HL_Node* node, int index);
260
269hsize_t HLNode_getNumberOfPoints(HL_Node* node);
270
277
284
291
297void HLNode_setCompression(HL_Node* node, HL_Compression* compression);
298
307int HLNode_commitType(HL_Node* node,hid_t typid);
308
309#endif
HL_Node * HLNode_new(const char *name)
Creates a new HL_Node instance.
Definition hlhdf_node.c:179
int HLNode_commitType(HL_Node *node, hid_t typid)
Will mark the node to be committed, only applicable on type nodes.
Definition hlhdf_node.c:652
HL_DataType
This is an enumeration variable designed to identify the type of data in a given node.
Definition hlhdf_types.h:236
HL_NodeMark
This is an enumeration variable designed to keep track of the status of a given node.
Definition hlhdf_types.h:246
HL_Node * HLNode_newGroup(const char *name)
Creates an empty group HL_Node of type HL_Type::GROUP_ID.
Definition hlhdf_node.c:244
HL_Node * HLNode_newReference(const char *name)
Creates an empty reference HL_Node of type HL_Type::REFERENCE_ID.
Definition hlhdf_node.c:264
HL_Node * HLNode_copy(HL_Node *node)
Copies an HL_Node.
Definition hlhdf_node.c:269
void HLNode_free(HL_Node *node)
Deallocates the provided node.
Definition hlhdf_node.c:218
HL_Node * HLNode_newDatatype(const char *name)
Creates an empty data type HL_Node of type HL_Type::TYPE_ID.
Definition hlhdf_node.c:259
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.
Definition hlhdf_node.c:376
HL_Node * HLNode_newAttribute(const char *name)
Creates an empty attribute HL_Node of type HL_Type::ATTRIBUTE_ID.
Definition hlhdf_node.c:249
HL_Type
This is an enumeration variable designed to identify the type of a given node.
Definition hlhdf_types.h:222
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.
Definition hlhdf_node.c:317
HL_Node * HLNode_newDataset(const char *name)
Creates an empty data set HL_Node of type HL_Type::DATASET_ID.
Definition hlhdf_node.c:254
HL_FormatSpecifier HLNode_getFormat(HL_Node *node)
Returns the format specifier for the node.
Definition hlhdf_node.c:528
void HLNode_setFetched(HL_Node *node, int fetched)
Sets if this node has got its data fetched or not.
Definition hlhdf_node.c:510
const char * HLNode_getName(HL_Node *node)
Returns the node name.
Definition hlhdf_node.c:451
hsize_t HLNode_getNumberOfPoints(HL_Node *node)
Returns the number of value points that this node has.
Definition hlhdf_node.c:609
int HLNode_setDimensions(HL_Node *node, int ndims, hsize_t *dims)
Sets the node dimensions.
Definition hlhdf_node.c:547
void HLNode_setDataType(HL_Node *node, HL_DataType datatype)
Sets the data type of the node.
Definition hlhdf_node.c:534
size_t HLNode_getDataSize(HL_Node *node)
Returns the type size for the data format.
Definition hlhdf_node.c:463
HL_DataType HLNode_getDataType(HL_Node *node)
Returns the data type of the node.
Definition hlhdf_node.c:540
void HLNode_setMark(HL_Node *node, const HL_NodeMark mark)
Marks a node.
Definition hlhdf_node.c:492
void HLNode_setCompoundDescription(HL_Node *node, HL_CompoundTypeDescription *descr)
Sets the description for this node.
Definition hlhdf_node.c:626
int HLNode_nameEquals(HL_Node *node, const char *name)
Compares the nodes name with the provided name.
Definition hlhdf_node.c:481
hsize_t HLNode_getDimension(HL_Node *node, int index)
Returns the dimension of the specified index.
Definition hlhdf_node.c:600
unsigned char * HLNode_getRawdata(HL_Node *node)
Returns the internal rawdata pointer for this node.
Definition hlhdf_node.c:469
int HLNode_getRank(HL_Node *node)
Returns the rank (number of dimensions).
Definition hlhdf_node.c:594
HL_Type HLNode_getType(HL_Node *node)
Gets the type of the node.
Definition hlhdf_node.c:516
const char * HLNode_getFormatName(HL_Node *node)
Gets the string represenation of the data format.
Definition hlhdf_node.c:522
HL_NodeMark HLNode_getMark(HL_Node *node)
Returns the mark of a node.
Definition hlhdf_node.c:498
void HLNode_setCompression(HL_Node *node, HL_Compression *compression)
Sets the compression object for this node.
Definition hlhdf_node.c:645
HL_Compression * HLNode_getCompression(HL_Node *node)
Returns the compression object for this node.
Definition hlhdf_node.c:639
int HLNode_fetched(HL_Node *node)
Returns if the data for this node has been extracted from the hdf5 file or not.
Definition hlhdf_node.c:504
unsigned char * HLNode_getData(HL_Node *node)
Returns the internal data pointer for this node.
Definition hlhdf_node.c:457
void HLNode_getDimensions(HL_Node *node, int *ndims, hsize_t **dims)
Gets the node dimensions.
Definition hlhdf_node.c:573
HL_CompoundTypeDescription * HLNode_getCompoundDescription(HL_Node *node)
Returns the compound description for the node (if any).
Definition hlhdf_node.c:633
size_t HLNode_getRawdataSize(HL_Node *node)
Returns the type size for the raw data format.
Definition hlhdf_node.c:475
Type definitions that are used in HLHDF.
HL_FormatSpecifier
These are all valid format specifiers that are used within HLHDF.
Definition hlhdf_types.h:70
This type is a list of HL_CompoundTypeAttributes.
Definition hlhdf_types.h:276
Compression properties.
Definition hlhdf_types.h:181
Represents a HDF5 object/attribute/reference/...
Definition hlhdf_node.c:40