Пример #1
0
//-*****************************************************************************
OwData::OwData( hid_t iParentGroup,
                const std::string &iName,
                const AbcA::MetaData &iMetaData )
    : m_group( -1 )
{
    // Check validity of all inputs.
    ABCA_ASSERT( iParentGroup >= 0, "Invalid parent group" );

    // Create the HDF5 group corresponding to this object.
    hid_t copl = CreationOrderPlist();
    m_group = H5Gcreate2( iParentGroup, iName.c_str(),
                          H5P_DEFAULT, copl, H5P_DEFAULT );
    H5Pclose( copl );
    ABCA_ASSERT( m_group >= 0,
                 "Could not create group for object: " << iName );

    m_data.reset( new CpwData( ".prop", m_group ) );

    AbcA::PropertyHeader topHeader( ".prop", iMetaData );
    WritePropertyInfo( m_group, topHeader, false, 0, 0, 0, 0 );
}
Пример #2
0
//-*****************************************************************************
hid_t BaseCpwImpl::getGroup()
{
    // If we've already made it, return it!
    if ( m_group >= 0 )
    {
        return m_group;
    }

    ABCA_ASSERT( m_parentGroup >= 0, "invalid parent group" );

    // Create the HDF5 group corresponding to this property.
    const std::string groupName = getName();

    hid_t copl = CreationOrderPlist();
    m_group = H5Gcreate2( m_parentGroup, groupName.c_str(),
                          H5P_DEFAULT, copl, H5P_DEFAULT );
    H5Pclose( copl );

    ABCA_ASSERT( m_group >= 0,
                 "Could not create compound property group named: "
                 << groupName );

    return m_group;
}