HdfDefines.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /// \copyright Copyright (c) Catalysts GmbH
  2. /// \author Patrik Kovacs, Catalysts GmbH
  3. #ifndef HDF4CPP_HDFDEFINES_H
  4. #define HDF4CPP_HDFDEFINES_H
  5. #include <map>
  6. #include <mfhdf.h>
  7. #ifdef NEEDS_NORETURN
  8. #define NORETURN __declspec(noreturn)
  9. #else
  10. #define NORETURN
  11. #endif
  12. #define MAX_DIMENSION 32
  13. #define MAX_NAME_LENGTH 1000
  14. namespace hdf4cpp {
  15. /// \enum Type
  16. /// The type of the HdfObject.
  17. /// \var HFILE
  18. /// file type
  19. /// \var SDATA
  20. /// SData type
  21. /// \var VGROUP
  22. /// VGroup type
  23. /// \var VDATA
  24. /// VData type
  25. enum Type { HFILE, SDATA, VGROUP, VDATA };
  26. /// \enum ClassType
  27. /// What kind of object it represents:
  28. /// \var FILE
  29. /// file
  30. /// \var ITEM
  31. /// item
  32. /// \var ATTRIBUTE
  33. /// attribute
  34. /// \var ITERATOR
  35. /// iterator
  36. enum ClassType { FILE, ITEM, ATTRIBUTE, ITERATOR };
  37. /// \enum ExceptionType The type of the HdfException
  38. enum ExceptionType {
  39. INVALID_ID,
  40. INVALID_OPERATION,
  41. INVALID_NAME,
  42. OUT_OF_RANGE,
  43. BUFFER_SIZE_NOT_ENOUGH,
  44. BUFFER_SIZE_NOT_DIVISIBLE,
  45. INVALID_RANGES,
  46. STATUS_RETURN_FAIL,
  47. INVALID_DATA_TYPE,
  48. OTHER
  49. };
  50. const std::multimap<int32, int32> typeSizeMap = {
  51. {DFNT_CHAR, SIZE_CHAR}, {DFNT_CHAR8, SIZE_CHAR8}, {DFNT_CHAR16, SIZE_CHAR16}, {DFNT_FLOAT32, SIZE_FLOAT32},
  52. {DFNT_FLOAT64, SIZE_FLOAT64}, {DFNT_FLOAT128, SIZE_FLOAT128}, {DFNT_INT8, SIZE_INT8}, {DFNT_INT16, SIZE_INT16},
  53. {DFNT_INT32, SIZE_INT32}, {DFNT_INT64, SIZE_INT64}, {DFNT_UINT8, SIZE_UINT8}, {DFNT_UINT16, SIZE_UINT16},
  54. {DFNT_UINT32, SIZE_UINT32}, {DFNT_UINT64, SIZE_UINT64}, {DFNT_UCHAR, SIZE_UCHAR}, {DFNT_UCHAR8, SIZE_UCHAR8},
  55. {DFNT_UCHAR16, SIZE_UCHAR16},
  56. };
  57. }
  58. #endif // HDF4CPP_HDFDEFINES_H