Alembic: AbcCoreHDF5/HDF5Util.h Source File

Alembic 1.8.11

Loading...
Searching...
No Matches
HDF5Util.h
1//-*****************************************************************************
2//
3// Copyright (c) 2009-2012,
4// Sony Pictures Imageworks, Inc. and
5// Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd.
6//
7// All rights reserved.
8//
9// Redistribution and use in source and binary forms, with or without
10// modification, are permitted provided that the following conditions are
11// met:
12// * Redistributions of source code must retain the above copyright
13// notice, this list of conditions and the following disclaimer.
14// * Redistributions in binary form must reproduce the above
15// copyright notice, this list of conditions and the following disclaimer
16// in the documentation and/or other materials provided with the
17// distribution.
18// * Neither the name of Sony Pictures Imageworks, nor
19// Industrial Light & Magic nor the names of their contributors may be used
20// to endorse or promote products derived from this software without specific
21// prior written permission.
22//
23// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34//
35//-*****************************************************************************
36
37#ifndef Alembic_AbcCoreHDF5_HDF5Util_h
38#define Alembic_AbcCoreHDF5_HDF5Util_h
39
40#include <Alembic/AbcCoreHDF5/Foundation.h>
41#include <Alembic/AbcCoreHDF5/HDF5Hierarchy.h>
42
43namespace Alembic {
44namespace AbcCoreHDF5 {
45namespace ALEMBIC_VERSION_NS {
46
47//-*****************************************************************************
48typedef ::Alembic::Util::BaseDimensions<hsize_t> HDimensions;
49
50//-*****************************************************************************
51 struct AttrCloser
52{
53 AttrCloser( hid_t id ) : m_id( id ) {}
54 ~AttrCloser() { if ( m_id >= 0 ) H5Aclose( m_id ); }
55 hid_t m_id;
56};
57
58//-*****************************************************************************
59 struct DspaceCloser
60{
61 DspaceCloser( hid_t id ) : m_id( id ) {}
62 ~DspaceCloser() { if ( m_id >= 0 ) H5Sclose( m_id ); }
63 hid_t m_id;
64};
65
66//-*****************************************************************************
67 struct DsetCloser
68{
69 DsetCloser( hid_t id ) : m_id( id ) {}
70 ~DsetCloser() { if (m_id >= 0 ) H5Dclose( m_id ); }
71 hid_t m_id;
72};
73
74
75//-*****************************************************************************
76 struct GroupCloser
77{
78 GroupCloser( hid_t id ) : m_id( id ) {}
79 ~GroupCloser() { if ( m_id >= 0 ) H5Gclose( m_id ); }
80 hid_t m_id;
81};
82
83//-*****************************************************************************
84 struct DtypeCloser
85{
86 DtypeCloser( hid_t id ) : m_id( id ) {}
87 ~DtypeCloser() { if ( m_id >= 0 ) H5Tclose( m_id ); }
88 hid_t m_id;
89};
90
91//-*****************************************************************************
92 struct PlistCloser
93{
94 PlistCloser( hid_t id ) : m_id( id ) {}
95 ~PlistCloser() { if ( m_id >= 0 ) H5Pclose( m_id ); }
96 hid_t m_id;
97};
98
99//-*****************************************************************************
100hid_t CreationOrderPlist();
101hid_t DsetGzipCreatePlist( const Dimensions &dims, int level );
102
103//-*****************************************************************************
104bool EquivalentDatatypes( hid_t idA, hid_t idB );
105
106//-*****************************************************************************
107 H5Node OpenGroup( H5Node& iParent, const std::string& iName );
108
109//-*****************************************************************************
110void CloseObject (H5Node& iNode );
111
112//-*****************************************************************************
113bool GroupExists( H5Node& iParent, const std::string &iName );
114
115//-*****************************************************************************
116bool ObjectExists( H5Node& iParent, const std::string &iName );
117
118//-*****************************************************************************
119bool AttrExists( H5Node& iParent, const std::string &iName );
120
121//-*****************************************************************************
122bool DatasetExists( H5Node& iParent, const std::string &iName );
123
124} // End namespace ALEMBIC_VERSION_NS
125
126using namespace ALEMBIC_VERSION_NS;
127
128} // End namespace AbcCoreHDF5
129} // End namespace Alembic
130
131#endif
Alembic::AbcCoreHDF5::ALEMBIC_VERSION_NS::H5Node
Definition HDF5Hierarchy.h:50
Alembic
Alembic namespace ...
Definition ArchiveInfo.cpp:39