Mesh Oriented datABase  (version 5.4.1)
Array-based unstructured mesh datastructure
Tag data.
+ Collaboration diagram for Tag data.:

Modules

 Tag type values (MOAB-specific)

Functions

hid_t mhdf_getNativeType (hid_t input_type, int size, mhdf_Status *status)
 Make type native-endian.
void mhdf_createTag (mhdf_FileHandle file_handle, const char *tag_name, enum mhdf_TagDataType tag_type, int size, int storage, const void *default_value, const void *global_value, hid_t hdf_type, hid_t mhdf_base_type, mhdf_Status *status)
 Add a tag to the file.
hid_t mhdf_getTagDataType (mhdf_FileHandle file_handle, const char *tag_name, mhdf_Status *status)
 Get handle to HDF5 type object for tag data.
void mhdf_createVarLenTag (mhdf_FileHandle file_handle, const char *tag_name, enum mhdf_TagDataType tag_type, int storage, const void *default_value, int default_value_length, const void *global_value, int global_value_length, hid_t hdf_type, hid_t hdf_base_type, mhdf_Status *status)
 Add variable-length tag to file.
int mhdf_getNumberTags (mhdf_FileHandle file_handle, mhdf_Status *status)
 Get the number of tags in the file.
char ** mhdf_getTagNames (mhdf_FileHandle file_handle, int *num_names_out, mhdf_Status *status)
 Get the name for each tag defined in the file.
void mhdf_getTagInfo (mhdf_FileHandle file_handle, const char *tag_name, enum mhdf_TagDataType *class_out, int *size_out, int *tstt_storage_out, int *have_default_out, int *have_global_out, int *have_sparse_out, mhdf_Status *status)
 Get the description of a specified tag.
void mhdf_getTagValues (mhdf_FileHandle file_handle, const char *tag_name, hid_t output_data_type, void *default_value, void *global_value, mhdf_Status *status)
 Get the default and global values of the tag.
int mhdf_haveDenseTag (mhdf_FileHandle file_handle, const char *tag_name, const char *elem_group, mhdf_Status *status)
 Check if the file contains dense tag data for the specified tag and element group.
hid_t mhdf_createDenseTagData (mhdf_FileHandle file_handle, const char *tag_name, const char *elem_group, long num_values, mhdf_Status *status)
 Create an object to hold dense tag values for a given element group.
hid_t mhdf_openDenseTagData (mhdf_FileHandle file_handle, const char *tag_name, const char *elem_group, long *num_values_out, mhdf_Status *status)
 Open the object containing dense tag values for a given element group.
void mhdf_createSparseTagData (mhdf_FileHandle file_handle, const char *tag_name, long num_values, hid_t entities_and_values_out[2], mhdf_Status *status)
 Create file objects to store sparse tag data.
void mhdf_createVarLenTagData (mhdf_FileHandle file_handle, const char *tag_name, long num_entities, long num_values, hid_t entities_and_values_out[3], mhdf_Status *status)
 Create file objects to store (sparse) variable-length tag data.
void mhdf_openSparseTagData (mhdf_FileHandle file_handle, const char *tag_name, long *num_entity_out, long *num_values_out, hid_t entities_and_values_out[3], mhdf_Status *status)
 Create file objects to read sparse tag data.
void mhdf_writeSparseTagEntities (hid_t id_handle, long offset, long count, hid_t hdf_integer_type, const void *id_list, mhdf_Status *status)
 Write Global ID list for sparse tag data.
void mhdf_writeSparseTagEntitiesWithOpt (hid_t id_handle, long offset, long count, hid_t hdf_integer_type, const void *id_list, hid_t write_prop, mhdf_Status *status)
void mhdf_writeTagValues (hid_t value_handle, long offset, long count, hid_t hdf_tag_data_type, const void *tag_data, mhdf_Status *status)
 Write tag values.
void mhdf_writeTagValuesWithOpt (hid_t value_handle, long offset, long count, hid_t hdf_tag_data_type, const void *tag_data, hid_t write_prop, mhdf_Status *status)
void mhdf_writeSparseTagIndices (hid_t tag_handle, long offset, long count, hid_t hdf_integer_type, const void *end_indices, mhdf_Status *status)
 Write sparse tag end indices for variable-length tag data.
void mhdf_writeSparseTagIndicesWithOpt (hid_t tag_handle, long offset, long count, hid_t hdf_integer_type, const void *end_indices, hid_t write_prop, mhdf_Status *status)
void mhdf_readSparseTagEntities (hid_t id_handle, long offset, long count, hid_t hdf_integer_type, void *id_list, mhdf_Status *status)
 Read Global ID list for sparse tag data.
void mhdf_readSparseTagEntitiesWithOpt (hid_t id_handle, long offset, long count, hid_t hdf_integer_type, void *id_list, hid_t read_prop, mhdf_Status *status)
void mhdf_readTagValues (hid_t value_handle, long offset, long count, hid_t hdf_type, void *memory, mhdf_Status *status)
 Read tag values.
void mhdf_readTagValuesWithOpt (hid_t value_handle, long offset, long count, hid_t hdf_type, void *memory, hid_t read_prop, mhdf_Status *status)
void mhdf_readSparseTagIndices (hid_t tag_handle, long offset, long count, hid_t hdf_integer_type, void *end_indices, mhdf_Status *status)
 Read sparse tag end indices for variable-length tag data.
void mhdf_readSparseTagIndicesWithOpt (hid_t tag_handle, long offset, long count, hid_t hdf_integer_type, void *end_indices, hid_t read_prop, mhdf_Status *status)

Detailed Description

The data for each tag can be stored in two places/formats: sparse and/or dense. The data may be stored in both, but there should not be redundant values for the same entity.

Dense tag data is stored as multiple tables of tag values, one for each element group. (Note: special mhdf_ElemHandle values are available for accessing dense tag data on nodes or meshsets via the mhdf_node_type_handle and mhdf_set_type_handle functions.) Each dense tag table should contain the same number of entries as the element connectivity table. The tag values are associated with the corresponding element in the connectivity table.

Sparse tag data is stored as a global table pair for each tag type. The first if the pair of tables is a list of Global IDs. The second is the corresponding tag value for each entity in the ID list.


Function Documentation

hid_t mhdf_createDenseTagData ( mhdf_FileHandle  file_handle,
const char *  tag_name,
const char *  elem_group,
long  num_values,
mhdf_Status status 
)

Create an object to hold dense tag values for a given element group.

Parameters:
file_handleThe file.
tag_nameThe tag.
elem_groupThe element group handle, or the return value of mhdf_node_type_handle or mhdf_set_type_handle for nodes or sets respectively.
num_valuesThe number of tag values to be written. Must be The same as the number of elements in the group. Specified here to allow tag values to be written before node coordinates, element connectivity or meshsets.
statusPassed back status of API call.
Returns:
Handle to data object in file.

Definition at line 1268 of file tags.c.

References API_BEGIN, API_END_H, DENSE_TAG_SUBGROUP, get_tag_type(), struct_FileHandle::hdf_handle, mhdf_check_valid_file(), mhdf_create_table(), mhdf_elem_group_from_handle(), mhdf_malloc(), mhdf_name_to_path(), mhdf_node_type_handle(), mhdf_set_type_handle(), mhdf_setFail(), mhdf_setOkay(), NODE_GROUP, SET_GROUP, and size.

Referenced by moab::WriteHDF5::create_tag().

{
    char* path;
    hid_t elem_id, data_id, type_id;
    FileHandle* file_ptr;
    size_t name_len, path_len, dir_len;
    hsize_t size;
    API_BEGIN;

    file_ptr = (FileHandle*)file_handle;
    if( !mhdf_check_valid_file( file_ptr, status ) ) return -1;

    if( type_handle == mhdf_node_type_handle() )
    {
#if defined( H5Gopen_vers ) && H5Gopen_vers > 1
        elem_id = H5Gopen2( file_ptr->hdf_handle, NODE_GROUP, H5P_DEFAULT );
#else
        elem_id = H5Gopen( file_ptr->hdf_handle, NODE_GROUP );
#endif
        if( elem_id < 0 ) mhdf_setFail( status, "Could not open node group." );
    }
    else if( type_handle == mhdf_set_type_handle() )
    {
#if defined( H5Gopen_vers ) && H5Gopen_vers > 1
        elem_id = H5Gopen2( file_ptr->hdf_handle, SET_GROUP, H5P_DEFAULT );
#else
        elem_id = H5Gopen( file_ptr->hdf_handle, SET_GROUP );
#endif
        if( elem_id < 0 ) mhdf_setFail( status, "Could not open set group." );
    }
    else
    {
        elem_id = mhdf_elem_group_from_handle( file_ptr, type_handle, status );
    }
    if( elem_id < 0 ) return -1;

    dir_len  = strlen( DENSE_TAG_SUBGROUP );
    name_len = mhdf_name_to_path( tag_name, NULL, 0 );
    path_len = dir_len + name_len + 1;
    path     = (char*)mhdf_malloc( path_len, status );
    if( NULL == path )
    {
        H5Gclose( elem_id );
        return -1;
    }
    strcpy( path, DENSE_TAG_SUBGROUP );
    mhdf_name_to_path( tag_name, path + dir_len, name_len + 1 );

    type_id = get_tag_type( file_ptr, path + dir_len, status );
    if( type_id < 0 )
    {
        H5Gclose( elem_id );
        return -1;
    }

    size    = (hsize_t)num_values;
    data_id = mhdf_create_table( elem_id, path, type_id, 1, &size, status );
    free( path );
    H5Gclose( elem_id );
    H5Tclose( type_id );

    if( data_id > 0 ) mhdf_setOkay( status );

    API_END_H( 1 );
    return data_id;
}
void mhdf_createSparseTagData ( mhdf_FileHandle  file_handle,
const char *  tag_name,
long  num_values,
hid_t  entities_and_values_out[2],
mhdf_Status status 
)

Create file objects to store sparse tag data.

Create the file objects to store all sparse data for a given tag in. The sparse data is stored in a pair of objects. The first is a vector of global IDs. The second is a vector of tag values for each entity specified in the list of global IDs.

Parameters:
file_handleThe file.
tag_nameThe tag.
num_valuesThe number of tag values to be written.
entities_and_values_outThe handles to the file objects. The first is the vector of global IDs. The second is the list of corresponding tag values.
statusPassed back status of API call.

Definition at line 1402 of file tags.c.

References API_BEGIN, API_END_H, get_tag(), mhdf_create_table(), mhdf_setFail(), mhdf_setOkay(), SPARSE_ENTITY_NAME, SPARSE_VALUES_NAME, and TAG_TYPE_NAME.

Referenced by moab::WriteHDF5::create_tag().

{
    hid_t tag_id, index_id, data_id, type_id, id_type;
    hsize_t count = (hsize_t)num_values;
    API_BEGIN;

    tag_id = get_tag( file_handle, tag_name, &id_type, status );
    if( tag_id < 0 ) return;

#if defined( H5Topen_vers ) && H5Topen_vers > 1
    type_id = H5Topen2( tag_id, TAG_TYPE_NAME, H5P_DEFAULT );
#else
    type_id = H5Topen( tag_id, TAG_TYPE_NAME );
#endif
    if( type_id < 0 )
    {
        H5Gclose( tag_id );
        mhdf_setFail( status, "Failed to get type object for tag \"%s\".", tag_name );
        return;
    }

    index_id = mhdf_create_table( tag_id, SPARSE_ENTITY_NAME, id_type, 1, &count, status );
    if( index_id < 0 )
    {
        H5Gclose( tag_id );
        H5Tclose( type_id );
        return;
    }

    data_id = mhdf_create_table( tag_id, SPARSE_VALUES_NAME, type_id, 1, &count, status );
    H5Tclose( type_id );
    H5Gclose( tag_id );
    if( data_id < 0 )
    {
        H5Dclose( index_id );
        return;
    }

    handles_out[0] = index_id;
    handles_out[1] = data_id;
    mhdf_setOkay( status );
    API_END_H( 2 );
}
void mhdf_createTag ( mhdf_FileHandle  file_handle,
const char *  tag_name,
enum mhdf_TagDataType  tag_type,
int  size,
int  storage,
const void *  default_value,
const void *  global_value,
hid_t  hdf_type,
hid_t  mhdf_base_type,
mhdf_Status status 
)

Add a tag to the file.

Add a new tag to the file. This function must be called to define the tag characteristics before values for the tag can be written.

Parameters:
file_handleThe file
tag_nameThe tag name
tag_typeThe tag type.
sizeIf tag_type == mhdf_BITFIELD, the number of bits. If tag_type == mhdf_OPAQUE, the size of the opaque type in bytes. Otherwise the length of the array of tag_type entities associated with each mesh entity, or 1 for a scalar value.
storageMOAB storage type (dense, sparse, etc.)
default_valueDefault value for tag, or NULL if none.
global_valueGlobal value for tag, or NULL if none.
hdf_typeIf non-zero, assumed to be a user-specified type for opaque data. Ignored if tag_type is not mhdf_OPAQUE.
hdf_base_typeIgnored if hdf_type is non-zero. If hdf_type is zero and this type is non-zero, it is used either as the type or as the base type for an array type for default_value and global_value, respectively. Typically used to specify the input data type for mhdf_ENTITY_ID tags.

Definition at line 570 of file tags.c.

References API_BEGIN, API_END, and create_tag_common().

Referenced by moab::WriteHDF5::create_tag().

{
    hid_t tag_id;
    API_BEGIN;
    tag_id = create_tag_common( file_handle, tag_name, tag_type, size, storage, default_value, 1, global_value, 1,
                                hdf_type, hdf_base_type, status );
    if( tag_id >= 0 ) H5Gclose( tag_id );
    API_END;
}
void mhdf_createVarLenTag ( mhdf_FileHandle  file_handle,
const char *  tag_name,
enum mhdf_TagDataType  tag_type,
int  storage,
const void *  default_value,
int  default_value_length,
const void *  global_value,
int  global_value_length,
hid_t  hdf_type,
hid_t  hdf_base_type,
mhdf_Status status 
)

Add variable-length tag to file.

Add a new tag to the file. This function must be called to define the tag characteristics before values for the tag can be written. Use this function if the tag values are not fixed-length.

Parameters:
file_handleThe file
tag_nameThe tag name
tag_typeThe tag type.
storageMOAB storage type (dense, sparse, etc.)
default_valueDefault value for tag, or NULL if none.
default_value_lengthLength of default value.
global_valueGlobal value for tag, or NULL if none.
global_value_lengthLength of global value.
hdf_typeIf non-zero, assumed to be a user-specified type for opaque data. Ignored if tag_type is not mhdf_OPAQUE.
hdf_base_typeIgnored if hdf_type is non-zero. If hdf_type is zero and this type is non-zero, it is used either as the type or as the base type for an array type for default_value and global_value, respectively. Typically used to specify the input data type for mhdf_ENTITY_ID tags.

Definition at line 589 of file tags.c.

References API_BEGIN, API_END, create_tag_common(), mhdf_create_scalar_attrib(), and TAG_VARLEN_ATTRIB.

Referenced by moab::WriteHDF5::create_tag().

{
    hid_t tag_id;
    int one = 1;

    API_BEGIN;
    tag_id = create_tag_common( file_handle, tag_name, tag_type, -1, storage, default_value, default_value_length,
                                global_value, global_value_length, hdf_type, hdf_base_type, status );
    if( tag_id >= 0 )
    {
        mhdf_create_scalar_attrib( tag_id, TAG_VARLEN_ATTRIB, H5T_NATIVE_INT, &one, status );
        H5Gclose( tag_id );
    }
    API_END;
}
void mhdf_createVarLenTagData ( mhdf_FileHandle  file_handle,
const char *  tag_name,
long  num_entities,
long  num_values,
hid_t  entities_and_values_out[3],
mhdf_Status status 
)

Create file objects to store (sparse) variable-length tag data.

Create the file objects to store all sparse data for a given tag in. The sparse data is stored in a pair of objects. The first is a vector of global IDs. The second is a vector of tag values for each entity specified in the list of global IDs.

Parameters:
file_handleThe file.
tag_nameThe tag.
num_entitiesThe number of entities for which tag values are to be stored
num_valuesThe total number of scalar values to be written (the total number of bytes of data for all tags for opaque data.)
entities_and_values_outThe handles to the file objects. The first is the vector of global IDs. The second is the list of corresponding tag values. The third is the handle to the index table.
statusPassed back status of API call.

Definition at line 1450 of file tags.c.

References API_BEGIN, API_END_H, get_tag(), mhdf_create_table(), MHDF_INDEX_TYPE, mhdf_setFail(), mhdf_setOkay(), SPARSE_ENTITY_NAME, SPARSE_VALUES_NAME, TAG_TYPE_NAME, and TAG_VAR_INDICES.

Referenced by moab::WriteHDF5::create_tag().

{
    hid_t tag_id, index_id, data_id, type_id, offset_id, id_type;
    hsize_t count = (hsize_t)num_entities;
    API_BEGIN;

    tag_id = get_tag( file_handle, tag_name, &id_type, status );
    if( tag_id < 0 ) return;

#if defined( H5Topen_vers ) && H5Topen_vers > 1
    type_id = H5Topen2( tag_id, TAG_TYPE_NAME, H5P_DEFAULT );
#else
    type_id = H5Topen( tag_id, TAG_TYPE_NAME );
#endif
    if( type_id < 0 )
    {
        H5Gclose( tag_id );
        mhdf_setFail( status, "Failed to get type object for tag \"%s\".", tag_name );
        return;
    }

    index_id = mhdf_create_table( tag_id, SPARSE_ENTITY_NAME, id_type, 1, &count, status );
    if( index_id < 0 )
    {
        H5Gclose( tag_id );
        H5Tclose( type_id );
        return;
    }

    offset_id = mhdf_create_table( tag_id, TAG_VAR_INDICES, MHDF_INDEX_TYPE, 1, &count, status );
    if( index_id < 0 )
    {
        H5Dclose( offset_id );
        H5Gclose( tag_id );
        H5Tclose( type_id );
        return;
    }

    count   = (hsize_t)num_values;
    data_id = mhdf_create_table( tag_id, SPARSE_VALUES_NAME, type_id, 1, &count, status );
    H5Tclose( type_id );
    H5Gclose( tag_id );
    if( data_id < 0 )
    {
        H5Dclose( offset_id );
        H5Dclose( index_id );
        return;
    }

    handles_out[0] = index_id;
    handles_out[1] = data_id;
    handles_out[2] = offset_id;
    mhdf_setOkay( status );
    API_END_H( 3 );
}
hid_t mhdf_getNativeType ( hid_t  input_type,
int  size,
mhdf_Status status 
)

Make type native-endian.

Given an atomic HDF5 data type, return the built-in type that matches the class of the passed type and is the specified size.

This function is provided to allow converting the stored tag type in a file to the preferred type for it's representation in memory when reading tag values.

This function works only for atomic types. The returned type will be a pre-defined HDF5 object and does not need to be closed/released.

Parameters:
input_typeThe type to convert.
sizeThe desired size in bytes.
statusPassed back status of API call.
Returns:
The converted type.

MOAB, a Mesh-Oriented datABase, is a software component for creating, storing and accessing finite element mesh data.

Copyright 2004 Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

Definition at line 30 of file tags.c.

References mhdf_getNativeType(), mhdf_setFail(), and mhdf_setOkay().

Referenced by mhdf_getNativeType().

{
    H5T_sign_t sgn;
    H5T_class_t cls;
    hid_t tmp_id, type_id;

    mhdf_setOkay( status );

    cls = H5Tget_class( input_type );
    switch( cls )
    {
        case H5T_FLOAT:
            switch( size )
            {
                case 4:
                    return H5T_NATIVE_FLOAT;
                case 8:
                    return H5T_NATIVE_DOUBLE;
                case 16:
                    return H5T_NATIVE_LDOUBLE;
                default:
                    mhdf_setFail( status, "Invalid size for floating point type: %d", size );
                    return -1;
            }

        case H5T_INTEGER:
            sgn = H5Tget_sign( input_type );
            if( H5T_SGN_ERROR == sgn )
            {
                mhdf_setFail( status, "Internall errror calling H5Tget_sign." );
                return -1;
            }
            if( sizeof( char ) == size )
                return sgn == H5T_SGN_NONE ? H5T_NATIVE_UCHAR : H5T_NATIVE_SCHAR;
            else if( sizeof( short ) == size )
                return sgn == H5T_SGN_NONE ? H5T_NATIVE_USHORT : H5T_NATIVE_SHORT;
            else if( sizeof( int ) == size )
                return sgn == H5T_SGN_NONE ? H5T_NATIVE_UINT : H5T_NATIVE_INT;
            else if( sizeof( long ) == size )
                return sgn == H5T_SGN_NONE ? H5T_NATIVE_ULONG : H5T_NATIVE_LONG;
            else if( (int)H5Tget_size( H5T_NATIVE_LLONG ) == size )
                return sgn == H5T_SGN_NONE ? H5T_NATIVE_ULLONG : H5T_NATIVE_LLONG;

            mhdf_setFail( status, "Invalid size for integer type: %d", size );
            return -1;

        case H5T_ENUM:
            tmp_id = H5Tget_super( input_type );
            if( tmp_id < 0 )
            {
                mhdf_setFail( status, "Internal error calling H5Tget_super." );
                return -1;
            }
            type_id = mhdf_getNativeType( tmp_id, size, status );
            H5Tclose( tmp_id );
            return type_id;

        case H5T_TIME:
        case H5T_OPAQUE:
        case H5T_REFERENCE:
            mhdf_setFail( status, "Unsupported type class." );
            return -1;

        case H5T_COMPOUND:
        case H5T_VLEN:
        case H5T_ARRAY:
        case H5T_STRING:
            mhdf_setFail( status, "Only atomic types are supported." );
            return -1;

        default:
            mhdf_setFail( status, "Internal error calling H5Tget_class.  Bad handle?" );
            return -1;
    }
}
int mhdf_getNumberTags ( mhdf_FileHandle  file_handle,
mhdf_Status status 
)

Get the number of tags in the file.

Parameters:
file_handleThe file.
statusPassed back status of API call.
Returns:
The number of tags.

Definition at line 615 of file tags.c.

References API_BEGIN, API_END, struct_FileHandle::hdf_handle, mhdf_check_valid_file(), mhdf_setFail(), mhdf_setOkay(), and TAG_GROUP.

{
    hid_t group_id;
    hsize_t result;
    FileHandle* file_ptr;
    API_BEGIN;

    /* Validate input */

    file_ptr = (FileHandle*)file_handle;
    if( !mhdf_check_valid_file( file_ptr, status ) ) return -1;

        /* Open the tags group */

#if defined( H5Gopen_vers ) && H5Gopen_vers > 1
    group_id = H5Gopen2( file_ptr->hdf_handle, TAG_GROUP, H5P_DEFAULT );
#else
    group_id = H5Gopen( file_ptr->hdf_handle, TAG_GROUP );
#endif
    if( group_id < 0 )
    {
        mhdf_setFail( status, "H5Gopen(\"%s\") failed", TAG_GROUP );
        return -1;
    }

    /* Get number of objects in tags group */

    if( H5Gget_num_objs( group_id, &result ) < 0 )
    {
        mhdf_setFail( status, "Internal failure calling H5Gget_num_objs." );
        H5Gclose( group_id );
        return -1;
    }

    H5Gclose( group_id );
    mhdf_setOkay( status );
    API_END;
    return (int)result;
}
hid_t mhdf_getTagDataType ( mhdf_FileHandle  file_handle,
const char *  tag_name,
mhdf_Status status 
)

Get handle to HDF5 type object for tag data.

Definition at line 537 of file tags.c.

References API_BEGIN, API_END, get_tag_type(), mhdf_check_valid_file(), mhdf_name_to_path_copy(), and mhdf_setFail().

{
    FileHandle* file_ptr;
    hid_t result;
    char* path;
    API_BEGIN;

    /* Validate input */

    file_ptr = (FileHandle*)file_handle;
    if( !mhdf_check_valid_file( file_ptr, status ) ) return -1;

    if( !tag_name || !*tag_name )
    {
        mhdf_setFail( status, "Invalid tag name" );
        return -1;
    }

    /* Create path string for tag object */

    path = mhdf_name_to_path_copy( tag_name, status );
    if( !path )
    {
        return -1;
    }

    result = get_tag_type( file_ptr, path, status );

    free( path );
    API_END;
    return result;
}
void mhdf_getTagInfo ( mhdf_FileHandle  file_handle,
const char *  tag_name,
enum mhdf_TagDataType class_out,
int *  size_out,
int *  tstt_storage_out,
int *  have_default_out,
int *  have_global_out,
int *  have_sparse_out,
mhdf_Status status 
)

Get the description of a specified tag.

Get everything about a tag except the actual values.

Parameters:
file_handleThe file.
tag_nameThe name of the tag to retrieve the data for.
class_outThe TSTT class of the tag data.
size_outDepends on value of class_out:
  • mhdf_OPAQUE - size of opaque data in bytes
  • mhdf_BITFIELD - number of bits
  • if data is fixed-length array, length of array
  • if data is single value, 1
  • if data is a variable-length array, -1
tstt_storage_outThe value of the TSTT enum for storage (dense, sparse, etc.)
have_default_outNon-zero if file contains a default value for the tag. Length of default value if variable-lenth tag.
have_global_outNon-zero if the file contains a global/mesh value for the tag.
have_sparse_outNon-zero if the file contains a sparse data table for this tag.

Definition at line 806 of file tags.c.

References API_BEGIN, API_END, get_attrib_array_length_name(), get_tag(), mhdf_BITFIELD, mhdf_BOOLEAN, mhdf_ENTITY_ID, mhdf_find_attribute(), mhdf_FLOAT, mhdf_INTEGER, mhdf_is_in_group(), mhdf_OPAQUE, mhdf_read_scalar_attrib(), mhdf_setFail(), mhdf_setOkay(), size, SPARSE_ENTITY_NAME, TAG_DEFAULT_ATTRIB, TAG_GLOBAL_ATTRIB, TAG_HANDLE_TYPE_ATTRIB, TAG_TYPE_ATTRIB, TAG_TYPE_NAME, and TAG_VARLEN_ATTRIB.

Referenced by get_tag_desc(), and main().

{
    hid_t tag_id, type_id, super_id;
    int i, rval, is_handle;
    hsize_t size, sup_size;
    unsigned int idx;
    int rank, var_data;
    hsize_t dims[H5S_MAX_RANK];
    int perm[H5S_MAX_RANK];
    H5T_class_t class_tmp;

    API_BEGIN;

    /* Validate input */
    if( NULL == tag_name || NULL == class_out || NULL == size_out || NULL == tstt_storage_out ||
        NULL == have_default_out || NULL == have_global_out || NULL == have_sparse_out )
    {
        mhdf_setFail( status, "Invalid input." );
        return;
    }

    /* Get group for tag */
    tag_id = get_tag( file_handle, tag_name, NULL, status );
    if( tag_id < 0 ) return;

    /* Check for sparse data */
    rval = mhdf_is_in_group( tag_id, SPARSE_ENTITY_NAME, status );
    if( rval < 0 )
    {
        H5Gclose( tag_id );
        return;
    }
    *have_sparse_out = rval ? 1 : 0;

    /* Check for variable-length tag data */
    rval = mhdf_find_attribute( tag_id, TAG_VARLEN_ATTRIB, &idx, status );
    if( rval < 0 )
    {
        H5Gclose( tag_id );
        return;
    }
    var_data = rval ? 1 : 0;

    /* Check if have default value for tag */
    rval = mhdf_find_attribute( tag_id, TAG_DEFAULT_ATTRIB, &idx, status );
    if( rval < 0 )
    {
        H5Gclose( tag_id );
        return;
    }
    if( !rval )
        *have_default_out = 0;
    else if( !var_data )
        *have_default_out = 1;
    else
    {
        /* *have_default_out = get_attrib_array_length_index( tag_id, index ); */
        *have_default_out = get_attrib_array_length_name( tag_id, TAG_DEFAULT_ATTRIB );
        if( *have_default_out < 0 )
        {
            mhdf_setFail( status, "Error checking length of default value for tag: %s\n", tag_name );
            H5Gclose( tag_id );
            return;
        }
    }

    /* Check if have global value for tag */
    rval = mhdf_find_attribute( tag_id, TAG_GLOBAL_ATTRIB, &idx, status );
    if( rval < 0 )
    {
        H5Gclose( tag_id );
        return;
    }
    if( !rval )
        *have_global_out = 0;
    else if( !var_data )
        *have_global_out = 1;
    else
    {
        /* *have_global_out = get_attrib_array_length_index( tag_id, index ); */
        *have_global_out = get_attrib_array_length_name( tag_id, TAG_GLOBAL_ATTRIB );
        if( *have_global_out < 0 )
        {
            mhdf_setFail( status, "Error checking length of global value for tag: %s\n", tag_name );
            H5Gclose( tag_id );
            return;
        }
    }

    /* Get TSTT tag class */
    rval = mhdf_read_scalar_attrib( tag_id, TAG_TYPE_ATTRIB, H5T_NATIVE_INT, tstt_storage_out, status );
    if( rval < 1 )
    {
        H5Gclose( tag_id );
        return;
    }

    /* Check if tag is storing entity handles */
    rval = mhdf_find_attribute( tag_id, TAG_HANDLE_TYPE_ATTRIB, &idx, status );
    if( rval < 0 )
    {
        H5Gclose( tag_id );
        return;
    }
    is_handle = rval;

    /* Get tag type */
#if defined( H5Topen_vers ) && H5Topen_vers > 1
    type_id = H5Topen2( tag_id, TAG_TYPE_NAME, H5P_DEFAULT );
#else
    type_id = H5Topen( tag_id, TAG_TYPE_NAME );
#endif
    if( type_id < 0 )
    {
        H5Gclose( tag_id );
        mhdf_setFail( status, "Failed to get type object for tag \"%s\".", tag_name );
        return;
    }

    class_tmp = H5Tget_class( type_id );
    if( class_tmp < 0 )
    {
        mhdf_setFail( status, "H5Tget_class failed." );
        H5Gclose( tag_id );
        H5Tclose( type_id );
        return;
    }

    size = H5Tget_size( type_id );
    if( size <= 0 )
    {
        mhdf_setFail( status, "H5Tget_size failed." );
        H5Gclose( tag_id );
        H5Tclose( type_id );
        return;
    }

    switch( class_tmp )
    {
        case H5T_INTEGER:
            *class_out = ( size == 1 ) ? mhdf_BOOLEAN : mhdf_INTEGER;
            *size_out  = 1;
            break;

        case H5T_FLOAT:
            *class_out = mhdf_FLOAT;
            *size_out  = 1;
            break;

        case H5T_BITFIELD:
            *class_out = mhdf_BITFIELD;
            *size_out  = H5Tget_precision( type_id );
            if( *size_out <= 0 )
            {
                mhdf_setFail( status, "H5Tget_precision failed." );
                H5Gclose( tag_id );
                H5Tclose( type_id );
                return;
            }
            break;

        default:
        case H5T_OPAQUE:
            *class_out = mhdf_OPAQUE;
            *size_out  = size;
            break;

        case H5T_ARRAY:

#if defined( H5Tget_array_dims_vers ) && H5Tget_array_dims_vers > 1
            (void)perm; /* suppress warning */
            rank = H5Tget_array_dims2( type_id, dims );
#else
            rank      = H5Tget_array_dims( type_id, dims, perm );
#endif
            if( rank <= 0 )
            {
                mhdf_setFail( status, "H5Tget_size failed." );
                H5Gclose( tag_id );
                H5Tclose( type_id );
                return;
            }
            for( i = 1; i < rank; ++i )
                dims[0] *= dims[i];

            super_id = H5Tget_super( type_id );
            if( super_id < 0 )
            {
                mhdf_setFail( status, "H5Tget_super failed" );
                H5Gclose( tag_id );
                H5Tclose( type_id );
                return;
            }

            class_tmp = H5Tget_class( super_id );
            if( class_tmp < 0 )
            {
                mhdf_setFail( status, "H5Tget_class failed." );
                H5Gclose( tag_id );
                H5Tclose( type_id );
                H5Tclose( super_id );
                return;
            }

            sup_size = H5Tget_size( super_id );
            H5Tclose( super_id );
            if( sup_size <= 0 )
            {
                mhdf_setFail( status, "H5Tget_size failed." );
                H5Gclose( tag_id );
                H5Tclose( type_id );
                return;
            }

            switch( class_tmp )
            {
                case H5T_INTEGER:
                    *class_out = ( sup_size == 1 ) ? mhdf_BOOLEAN : mhdf_INTEGER;
                    *size_out  = dims[0];
                    break;

                case H5T_FLOAT:
                    *class_out = mhdf_FLOAT;
                    *size_out  = dims[0];
                    break;

                default:
                    *class_out = mhdf_OPAQUE;
                    *size_out  = size;
                    break;
            }

            break;
    }
    H5Tclose( type_id );
    H5Gclose( tag_id );

    if( is_handle )
    {
        if( *class_out != mhdf_INTEGER )
        {
            mhdf_setFail( status, "Non-integer tag marked as handle type." );
            return;
        }
        *class_out = mhdf_ENTITY_ID;
    }

    if( var_data )
    {
        if( *size_out != 1 || *class_out == mhdf_BITFIELD )
        {
            mhdf_setFail( status, "Invalid or unexpected variable-length tag data" );
            return;
        }
        *size_out = -1;
    }

    mhdf_setOkay( status );
    API_END;
}
char** mhdf_getTagNames ( mhdf_FileHandle  file_handle,
int *  num_names_out,
mhdf_Status status 
)

Get the name for each tag defined in the file.

Parameters:
file_handleThe file.
num_names_outThe length of the returned array of strings.
statusPassed back status of API call.
Returns:
An array of null-terminated strings. The array and each string is allocated with malloc. The caller should release this memory by calling free for each string and the array.

Definition at line 655 of file tags.c.

References API_BEGIN, API_END, struct_FileHandle::hdf_handle, mhdf_check_valid_file(), mhdf_malloc(), mhdf_path_to_name(), mhdf_setFail(), mhdf_setOkay(), size, and TAG_GROUP.

Referenced by mhdf_getFileSummary().

{
    hid_t group_id;
    FileHandle* file_ptr;
    hsize_t count, idx;
    char* name;
    char** result;
    ssize_t size;
    API_BEGIN;

    /* Validate input */

    file_ptr = (FileHandle*)file_handle;
    if( !mhdf_check_valid_file( file_ptr, status ) ) return NULL;

        /* Open the tags group */

#if defined( H5Gopen_vers ) && H5Gopen_vers > 1
    group_id = H5Gopen2( file_ptr->hdf_handle, TAG_GROUP, H5P_DEFAULT );
#else
    group_id = H5Gopen( file_ptr->hdf_handle, TAG_GROUP );
#endif
    if( group_id < 0 )
    {
        mhdf_setFail( status, "H5Gopen(\"%s\") failed", TAG_GROUP );
        return NULL;
    }

    /* Get number of objects in tags group */

    if( H5Gget_num_objs( group_id, &count ) < 0 )
    {
        mhdf_setFail( status, "Internal failure calling H5Gget_num_objs." );
        H5Gclose( group_id );
        return NULL;
    }

    /* No tags? */

    *num_names_out = (int)count;
    if( count == 0 )
    {
        H5Gclose( group_id );
        mhdf_setOkay( status );
        return NULL;
    }

    /* Allocate string array */

    result = (char**)mhdf_malloc( sizeof( char* ) * count, status );
    if( NULL == result )
    {
        H5Gclose( group_id );
        return NULL;
    }

    /* Get names */

    for( idx = 0; idx < count; ++idx )
    {
        size = H5Gget_objname_by_idx( group_id, idx, NULL, 0 );
        if( size < 1 || NULL == ( name = (char*)mhdf_malloc( size + 1, status ) ) )
        {
            while( ( --idx ) > 0 )
                free( result[idx] );
            free( result );
            H5Gclose( group_id );
            mhdf_setFail( status, "Internal failure calling H5Gget_objname_by_idx." );
            return NULL;
        }

        H5Gget_objname_by_idx( group_id, idx, name, size + 1 );
        if( !mhdf_path_to_name( name, name ) )
        {
            mhdf_setFail( status, "Invalid character string in internal file path: \"%s\"\n", name );
            return NULL;
        }
        result[idx] = name;
    }

    H5Gclose( group_id );
    mhdf_setOkay( status );
    API_END;
    return result;
}
void mhdf_getTagValues ( mhdf_FileHandle  file_handle,
const char *  tag_name,
hid_t  output_data_type,
void *  default_value,
void *  global_value,
mhdf_Status status 
)

Get the default and global values of the tag.

Parameters:
file_handleThe file.
tag_nameThe tag name.
output_data_typeThe HDF5 type for the memory into which the tag data is to be written. If zero, then the value(s) will be read as opaque data.
default_valueMemory location at which to write the default value of the tag.
global_valueIf the tag has a global value, the memory location at which to write that value.
statusPassed back status of API call.

Definition at line 1135 of file tags.c.

References API_BEGIN, API_END, get_tag(), mhdf_find_attribute(), mhdf_setFail(), mhdf_setOkay(), read_tag_attrib_data(), TAG_DEFAULT_ATTRIB, TAG_GLOBAL_ATTRIB, and TAG_VARLEN_ATTRIB.

Referenced by moab::ReadHDF5::create_tag(), and get_tag_desc().

{
    hid_t tag_id;
    int rval, var_data;
    unsigned int idx;
    API_BEGIN;

    /* check args */
    if( NULL == tag_name || !*tag_name )
    {
        mhdf_setFail( status, "Invalid input." );
        return;
    }

    /* Get the tag group */
    tag_id = get_tag( file_handle, tag_name, NULL, status );
    if( tag_id < 0 ) return;

    /* Check for variable-length tag data */
    rval = mhdf_find_attribute( tag_id, TAG_VARLEN_ATTRIB, &idx, status );
    if( rval < 0 )
    {
        H5Gclose( tag_id );
        return;
    }
    var_data = rval ? 1 : 0;

    /* Read default value if present */
    rval = read_tag_attrib_data( tag_id, TAG_DEFAULT_ATTRIB, output_data_type, default_value, var_data, status );
    if( !rval )
    {
        H5Gclose( tag_id );
        return;
    }

    /* Read mesh value if present */
    rval = read_tag_attrib_data( tag_id, TAG_GLOBAL_ATTRIB, output_data_type, global_value, var_data, status );
    if( !rval )
    {
        H5Gclose( tag_id );
        return;
    }

    H5Gclose( tag_id );
    mhdf_setOkay( status );
    API_END;
}
int mhdf_haveDenseTag ( mhdf_FileHandle  file_handle,
const char *  tag_name,
const char *  elem_group,
mhdf_Status status 
)

Check if the file contains dense tag data for the specified tag and element group.

Check if there is dense tag data for a given element type for the specified tag.

Parameters:
file_handleThe file.
tag_nameThe tag.
elem_groupThe element group handle, or the return value of mhdf_node_type_handle or mhdf_set_type_handle for nodes or sets respectively.
statusPassed back status of API call.
Returns:
Non-zero if file contains specified data. Zero otherwise.

Definition at line 1188 of file tags.c.

References API_BEGIN, API_END, DENSE_TAG_SUBGROUP, struct_FileHandle::hdf_handle, mhdf_check_valid_file(), mhdf_elem_group_from_handle(), mhdf_is_in_group(), mhdf_name_to_path_copy(), mhdf_node_type_handle(), mhdf_set_type_handle(), mhdf_setFail(), mhdf_setOkay(), NODE_GROUP, SET_GROUP, and TAG_GROUP_NAME.

Referenced by main(), and mhdf_getFileSummary().

{
    char* path;
    hid_t elem_id, group_id;
    FileHandle* file_ptr;
    int rval = 0;
    API_BEGIN;

    file_ptr = (FileHandle*)file_handle;
    if( !mhdf_check_valid_file( file_ptr, status ) ) return -1;

    if( type_handle == mhdf_node_type_handle() )
    {
#if defined( H5Gopen_vers ) && H5Gopen_vers > 1
        elem_id = H5Gopen2( file_ptr->hdf_handle, NODE_GROUP, H5P_DEFAULT );
#else
        elem_id = H5Gopen( file_ptr->hdf_handle, NODE_GROUP );
#endif
        if( elem_id < 0 ) mhdf_setFail( status, "Could not open node group." );
    }
    else if( type_handle == mhdf_set_type_handle() )
    {
#if defined( H5Gopen_vers ) && H5Gopen_vers > 1
        elem_id = H5Gopen2( file_ptr->hdf_handle, SET_GROUP, H5P_DEFAULT );
#else
        elem_id = H5Gopen( file_ptr->hdf_handle, SET_GROUP );
#endif
        if( elem_id < 0 ) mhdf_setFail( status, "Could not open set group." );
    }
    else
    {
        elem_id = mhdf_elem_group_from_handle( file_ptr, type_handle, status );
    }
    if( elem_id < 0 ) return -1;

    rval = mhdf_is_in_group( elem_id, TAG_GROUP_NAME, status );
    if( rval < 0 )
    {
        H5Gclose( elem_id );
        return -1;
    }
    else if( rval == 0 )
    {
        H5Gclose( elem_id );
        mhdf_setOkay( status );
        return 0;
    }

#if defined( H5Gopen_vers ) && H5Gopen_vers > 1
    group_id = H5Gopen2( elem_id, DENSE_TAG_SUBGROUP, H5P_DEFAULT );
#else
    group_id = H5Gopen( elem_id, DENSE_TAG_SUBGROUP );
#endif
    H5Gclose( elem_id );
    if( group_id < 0 )
    {
        mhdf_setFail( status, "Could not open tag subgroup." );
        return -1;
    }

    path = mhdf_name_to_path_copy( tag_name, status );
    if( NULL == path )
    {
        H5Gclose( group_id );
        return -1;
    }

    rval = mhdf_is_in_group( group_id, path, status );
    H5Gclose( group_id );
    free( path );

    if( rval >= 0 )
    {
        mhdf_setOkay( status );
    }

    API_END;
    return rval;
}
hid_t mhdf_openDenseTagData ( mhdf_FileHandle  file_handle,
const char *  tag_name,
const char *  elem_group,
long *  num_values_out,
mhdf_Status status 
)

Open the object containing dense tag values for a given element group.

Parameters:
file_handleThe file.
tag_nameThe tag.
elem_groupThe element group handle, or the return value of mhdf_node_type_handle or mhdf_set_type_handle for nodes or sets respectively.
num_values_outThe number of tag values to be written. Must be The same as the number of elements in the group.
statusPassed back status of API call.
Returns:
Handle to data object in file.

Definition at line 1339 of file tags.c.

References API_BEGIN, API_END_H, DENSE_TAG_SUBGROUP, struct_FileHandle::hdf_handle, mhdf_check_valid_file(), mhdf_elem_group_from_handle(), mhdf_malloc(), mhdf_name_to_path(), mhdf_node_type_handle(), mhdf_open_table(), mhdf_set_type_handle(), mhdf_setFail(), mhdf_setOkay(), NODE_GROUP, SET_GROUP, and size.

Referenced by check_valid_tag(), main(), mhdf_getFileSummary(), moab::ReadHDF5::read_tag(), moab::ReadHDF5::read_tag_values_all(), moab::ReadHDF5::read_tag_values_partial(), moab::ReadHDF5::search_tag_values(), and moab::WriteHDF5::write_dense_tag().

{
    char* path;
    hid_t elem_id, data_id;
    FileHandle* file_ptr;
    size_t name_len, path_len, dir_len;
    hsize_t size;
    API_BEGIN;

    file_ptr = (FileHandle*)file_handle;
    if( !mhdf_check_valid_file( file_ptr, status ) ) return -1;

    if( type_handle == mhdf_node_type_handle() )
    {
#if defined( H5Gopen_vers ) && H5Gopen_vers > 1
        elem_id = H5Gopen2( file_ptr->hdf_handle, NODE_GROUP, H5P_DEFAULT );
#else
        elem_id = H5Gopen( file_ptr->hdf_handle, NODE_GROUP );
#endif
        if( elem_id < 0 ) mhdf_setFail( status, "Could not open node group." );
    }
    else if( type_handle == mhdf_set_type_handle() )
    {
#if defined( H5Gopen_vers ) && H5Gopen_vers > 1
        elem_id = H5Gopen2( file_ptr->hdf_handle, SET_GROUP, H5P_DEFAULT );
#else
        elem_id = H5Gopen( file_ptr->hdf_handle, SET_GROUP );
#endif
        if( elem_id < 0 ) mhdf_setFail( status, "Could not open set group." );
    }
    else
    {
        elem_id = mhdf_elem_group_from_handle( file_ptr, type_handle, status );
    }
    if( elem_id < 0 ) return -1;

    dir_len  = strlen( DENSE_TAG_SUBGROUP );
    name_len = mhdf_name_to_path( tag_name, NULL, 0 );
    path_len = dir_len + name_len + 1;
    path     = (char*)mhdf_malloc( path_len, status );
    if( NULL == path )
    {
        H5Gclose( elem_id );
        return -1;
    }
    strcpy( path, DENSE_TAG_SUBGROUP );
    mhdf_name_to_path( tag_name, path + dir_len, name_len + 1 );

    data_id = mhdf_open_table( elem_id, path, 1, &size, status );
    free( path );
    H5Gclose( elem_id );
    *num_values_out = (long)size;

    if( data_id >= 0 ) mhdf_setOkay( status );

    API_END_H( 1 );
    return data_id;
}
void mhdf_openSparseTagData ( mhdf_FileHandle  file_handle,
const char *  tag_name,
long *  num_entity_out,
long *  num_values_out,
hid_t  entities_and_values_out[3],
mhdf_Status status 
)

Create file objects to read sparse tag data.

Open the file objects containing all sparse data for a given tag in. The sparse data is stored in a pair of objects. The first is a vector of global IDs. The second is a vector of tag values for each entity specified in the list of global IDs. For variable-length tags, a third table containing end offsets for each tag value is returned in the third position of the output hid_t array (see mhdf_readSparseTagIndices.)

Parameters:
file_handleThe file.
tag_nameThe tag.
num_entity_outThe number of entities for which there are tag values.
num_values_outThe number of data values. For fixed-length tags, this is the same as num_entity_out. For variable-length tags, it is the total number of values in the data table.
entities_and_values_outThe handles to the pair of file objects. The first is the vector of global IDs. The second is the list of corresponding tag values. The third is the handle to the index table, iff the tag is variable-length. If the tag is fixed-length, this value is not set.
statusPassed back status of API call.

Definition at line 1511 of file tags.c.

References API_BEGIN, API_END_H, get_tag(), mhdf_find_attribute(), mhdf_open_table(), mhdf_setFail(), mhdf_setOkay(), SPARSE_ENTITY_NAME, SPARSE_VALUES_NAME, TAG_VAR_INDICES, and TAG_VARLEN_ATTRIB.

Referenced by check_valid_tag(), check_valid_var_len_tag(), moab::ReadHDF5::get_tagged_entities(), main(), mhdf_getFileSummary(), moab::ReadHDF5::read_tag(), moab::ReadHDF5::read_tag_values_all(), moab::ReadHDF5::read_tag_values_partial(), moab::ReadHDF5::search_tag_values(), moab::WriteHDF5::write_sparse_tag(), and moab::WriteHDF5::write_var_len_tag().

{
    hid_t tag_id, index_id, data_id, offset_id = -1;
    hsize_t num_ent, data_size, num_data;
    int rval;
    unsigned idx;
    API_BEGIN;

    tag_id = get_tag( file_handle, tag_name, NULL, status );
    if( tag_id < 0 ) return;

    index_id = mhdf_open_table( tag_id, SPARSE_ENTITY_NAME, 1, &num_ent, status );
    if( index_id < 0 )
    {
        H5Gclose( tag_id );
        return;
    }

    data_id = mhdf_open_table( tag_id, SPARSE_VALUES_NAME, 1, &data_size, status );
    if( data_id < 0 )
    {
        H5Gclose( tag_id );
        H5Dclose( index_id );
        return;
    }

    /* check if tag is variable-lentgth */
    rval = mhdf_find_attribute( tag_id, TAG_VARLEN_ATTRIB, &idx, status );
    if( rval < 0 )
    {
        H5Gclose( tag_id );
        H5Dclose( index_id );
        H5Dclose( data_id );
        return;
    }

    /* If variable length... */
    if( rval )
    {
        offset_id = mhdf_open_table( tag_id, TAG_VAR_INDICES, 1, &num_data, status );
        if( offset_id < 0 )
        {
            H5Gclose( tag_id );
            H5Dclose( index_id );
            H5Dclose( data_id );
            return;
        }
    }
    /* Otherwise the number of values is the same as the size of the data table */
    else
    {
        num_data = data_size;
    }

    H5Gclose( tag_id );
    if( num_ent != num_data )
    {
        mhdf_setFail( status, "Data length mismatch for sparse tag data -- invalid file." );
        if( offset_id >= 0 ) H5Dclose( offset_id );
        H5Dclose( index_id );
        H5Dclose( data_id );
        return;
    }
    *num_entity_out = (long)num_ent;
    if( num_values_out ) *num_values_out = (long)data_size;

    handles_out[0] = index_id;
    handles_out[1] = data_id;
    if( offset_id >= 0 ) handles_out[2] = offset_id;
    mhdf_setOkay( status );
    API_END_H( 2 );
}
void mhdf_readSparseTagEntities ( hid_t  id_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
void *  id_list,
mhdf_Status status 
)

Read Global ID list for sparse tag data.

Parameters:
id_handleThe first handle passed back from either mhdf_createSparseTagData or mhdf_openSparseTagData.
offsetThe offset at which to begin reading.
countThe number of global IDs to read.
hdf_integer_typeThe type of the integer data in id_list. Typically H5T_NATIVE_INT or N5T_NATIVE_LONG as defined in H5Tpublic.h. The HDF class of this type object must be H5T_INTEGER
id_listThe memory location at which to store the global IDs.
statusPassed back status of API call.

Definition at line 1660 of file tags.c.

References API_BEGIN, API_END, and mhdf_read_data().

Referenced by check_valid_tag(), check_valid_var_len_tag(), and main().

{
    API_BEGIN;
    mhdf_read_data( table_id, offset, count, int_type, id_list, H5P_DEFAULT, status );
    API_END;
}
void mhdf_readSparseTagEntitiesWithOpt ( hid_t  id_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
void *  id_list,
hid_t  read_prop,
mhdf_Status status 
)

Definition at line 1671 of file tags.c.

References API_BEGIN, API_END, and mhdf_read_data().

Referenced by moab::ReadHDF5::get_tagged_entities(), and moab::ReadHDF5::search_tag_values().

{
    API_BEGIN;
    mhdf_read_data( table_id, offset, count, int_type, id_list, io_prop, status );
    API_END;
}
void mhdf_readSparseTagIndices ( hid_t  tag_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
void *  end_indices,
mhdf_Status status 
)

Read sparse tag end indices for variable-length tag data.

Read sparse tag end indices for variable-length tag data. Each value in the list is the *last* index (zero-based) into the tag data for the corresponding entity.

Parameters:
tag_handlehandle to the data object to read from.
offsetThe offset into the table at which to begin reading
countThe number of values to read.
hdf_integer_typeThe type of the values pointed to by end_indices (must be an integer type).
end_indicesMemory in which to store the data read from the table.
statusOutput: API result.

Definition at line 1701 of file tags.c.

References API_BEGIN, API_END, and mhdf_read_data().

Referenced by check_valid_var_len_tag().

{
    API_BEGIN;
    mhdf_read_data( table_id, offset, count, int_type, indices, H5P_DEFAULT, status );
    API_END;
}
void mhdf_readSparseTagIndicesWithOpt ( hid_t  tag_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
void *  end_indices,
hid_t  read_prop,
mhdf_Status status 
)

Definition at line 1712 of file tags.c.

References API_BEGIN, API_END, and mhdf_read_data().

{
    API_BEGIN;
    mhdf_read_data( table_id, offset, count, int_type, indices, io_prop, status );
    API_END;
}
void mhdf_readTagValues ( hid_t  value_handle,
long  offset,
long  count,
hid_t  hdf_type,
void *  memory,
mhdf_Status status 
)

Read tag values.

Parameters:
value_handleThe second handle passed back from either mhdf_createSparseTagData or mhdf_openSparseTagData; or the handle returned by mhdf_createDenseTagData or mhdf_openDenseTagData.
offsetThe offset at which to begin reading.
countThe number of tag values to read.
hdf_typeThe type of the data in memory. If this is specified, it must be possible for the HDF library to convert between this type and the type the tag data is stored as. If zero, the values will be read as opaque data.
memoryMemory location at which to store tag values.
statusPassed back status of API call.

Definition at line 1684 of file tags.c.

References mhdf_readTagValuesWithOpt().

Referenced by check_valid_tag(), check_valid_var_len_tag(), and mhdf_getFileSummary().

{
    mhdf_readTagValuesWithOpt( table_id, offset, count, tag_type, tag_data, H5P_DEFAULT, status );
}
void mhdf_readTagValuesWithOpt ( hid_t  value_handle,
long  offset,
long  count,
hid_t  hdf_type,
void *  memory,
hid_t  read_prop,
mhdf_Status status 
)

Definition at line 1688 of file tags.c.

References API_BEGIN, API_END, and mhdf_read_data().

Referenced by mhdf_readTagValues(), moab::ReadHDF5::read_tag_values_all(), and moab::ReadHDF5::search_tag_values().

{
    API_BEGIN;
    mhdf_read_data( table_id, offset, count, tag_type, tag_data, io_prop, status );
    API_END;
}
void mhdf_writeSparseTagEntities ( hid_t  id_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
const void *  id_list,
mhdf_Status status 
)

Write Global ID list for sparse tag data.

Parameters:
id_handleThe first handle passed back from either mhdf_createSparseTagData or mhdf_openSparseTagData.
offsetThe offset at which to begin writing.
countThe number of global IDs to write.
hdf_integer_typeThe type of the integer data in id_list. Typically H5T_NATIVE_INT or N5T_NATIVE_LONG as defined in H5Tpublic.h. The HDF class of this type object must be H5T_INTEGER
id_listThe list of global IDs to write.
statusPassed back status of API call.

Definition at line 1589 of file tags.c.

References API_BEGIN, API_END, and mhdf_write_data().

{
    API_BEGIN;
    mhdf_write_data( table_id, offset, count, int_type, id_list, H5P_DEFAULT, status );
    API_END;
}
void mhdf_writeSparseTagEntitiesWithOpt ( hid_t  id_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
const void *  id_list,
hid_t  write_prop,
mhdf_Status status 
)

Definition at line 1600 of file tags.c.

References API_BEGIN, API_END, and mhdf_write_data().

Referenced by moab::WriteHDF5::write_sparse_ids().

{
    API_BEGIN;
    mhdf_write_data( table_id, offset, count, int_type, id_list, io_prop, status );
    API_END;
}
void mhdf_writeSparseTagIndices ( hid_t  tag_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
const void *  end_indices,
mhdf_Status status 
)

Write sparse tag end indices for variable-length tag data.

Write sparse tag end indices for variable-length tag data. Each value in the list is the *last* index (zero-based) into the tag data for the corresponding entity.

Parameters:
tag_handlehandle to the data object to write to.
offsetThe offset into the table at which to begin writting
countThe number of values to write.
hdf_integer_typeThe type of the values pointed to by end_indices (must be an integer type).
end_indicesThe values to store in the table.
statusOutput: API result.

Definition at line 1636 of file tags.c.

References API_BEGIN, API_END, and mhdf_write_data().

{
    API_BEGIN;
    mhdf_write_data( table_id, offset, count, int_type, indices, H5P_DEFAULT, status );
    API_END;
}
void mhdf_writeSparseTagIndicesWithOpt ( hid_t  tag_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
const void *  end_indices,
hid_t  write_prop,
mhdf_Status status 
)

Definition at line 1647 of file tags.c.

References API_BEGIN, API_END, and mhdf_write_data().

Referenced by moab::WriteHDF5::write_var_len_indices().

{
    API_BEGIN;
    mhdf_write_data( table_id, offset, count, int_type, indices, io_prop, status );
    API_END;
}
void mhdf_writeTagValues ( hid_t  value_handle,
long  offset,
long  count,
hid_t  hdf_tag_data_type,
const void *  tag_data,
mhdf_Status status 
)

Write tag values.

Parameters:
value_handleThe second handle passed back from either mhdf_createSparseTagData or mhdf_openSparseTagData; or the handle returned by mhdf_createDenseTagData or mhdf_openDenseTagData.
offsetThe offset at which to begin writing.
countThe number of tag values to write.
hdf_tag_data_typeThe type of the data in memory. It must be possible for the HDF library to convert between this type and the type the tag data is stored as.
tag_dataThe list of tag values to write.
statusPassed back status of API call.

Definition at line 1613 of file tags.c.

References mhdf_writeTagValuesWithOpt().

{
    mhdf_writeTagValuesWithOpt( table_id, offset, count, tag_type, tag_data, H5P_DEFAULT, status );
}
void mhdf_writeTagValuesWithOpt ( hid_t  value_handle,
long  offset,
long  count,
hid_t  hdf_tag_data_type,
const void *  tag_data,
hid_t  write_prop,
mhdf_Status status 
)

Definition at line 1623 of file tags.c.

References API_BEGIN, API_END, and mhdf_write_data().

Referenced by mhdf_writeTagValues(), moab::WriteHDF5::write_tag_values(), and moab::WriteHDF5::write_var_len_data().

{
    API_BEGIN;
    mhdf_write_data( table_id, offset, count, tag_type, tag_data, io_prop, status );
    API_END;
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines