OpendTect  6.6
hdf5common.h
Go to the documentation of this file.
1 #pragma once
2 /*+
3 ________________________________________________________________________
4 
5  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
6  Author: Bert
7  Date: Feb 2018
8 ________________________________________________________________________
9 
10 -*/
11 
12 #include "odhdf5mod.h"
13 #include "hdf5access.h"
14 
15 namespace HDF5
16 {
17 
18 } // namespace HDF5
19 
20 
21 // Catch stuff. Helpers first:
22 
23 #define mCatchHDF( act ) \
24  catch ( H5::Exception& exc ) \
25  { const char* mUnusedVar exc_msg = exc.getCDetailMsg(); act; }
26 
27 #define mCatchHDFAdd2uiRv() \
28  mCatchHDF( uirv.add( sHDF5Err( toUiString(exc_msg) ) ) )
29 
30 #define mCatchNonHDF( act ) \
31  catch ( std::exception& exc ) \
32  { const char* mUnusedVar exc_msg = exc.what(); act; } \
33  catch ( ... ) \
34  { const char* mUnusedVar exc_msg = "Unexpected non-std exception"; act; }
35 
36 #define mCatchNonHDFAdd2uiRv( err ) \
37  mCatchNonHDF( uirv.add(err.addMoreInfo(toUiString(exc_msg))) )
38 
39 
40 // Catch stuff. To use:
41 
42 #define mCatchAnyNoMsg( act ) \
43  catch ( ... ) \
44  { act; }
45 
46 #define mCatchAdd2uiRv( msg ) \
47  mCatchHDFAdd2uiRv() \
48  mCatchNonHDFAdd2uiRv( msg )
49 
50 #define mCatchUnexpected( act ) \
51  catch ( H5::Exception& exc ) \
52  { const char* mUnusedVar exc_msg = exc.getCDetailMsg(); pErrMsg(exc_msg); act; } \
53  catch ( std::exception& exc ) \
54  { const char* mUnusedVar exc_msg = exc.what(); pErrMsg(exc_msg); act; } \
55  catch ( ... ) \
56  { const char* mUnusedVar exc_msg = "Unexpected non-std exception"; \
57  pErrMsg(exc_msg); act; }
58 
59 // Err Ret stuff
60 
61 #define mRetNoFile(action) \
62  { pErrMsg( sOpenFileFirst() ); action; }
63 
64 #define mRetNeedScopeInUiRv() \
65  mPutInternalInUiRv( uirv, sNeedScope(), return )
HDF5
Definition: hdf5access.h:22
hdf5access.h

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2021