Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LimaGroup
Lima2
Commits
6938bbd6
Commit
6938bbd6
authored
Mar 07, 2022
by
Samuel Debionne
Committed by
Alejandro Homs Puron
May 04, 2022
Browse files
[IO] Refactor errinfo
parent
2aac3367
Changes
5
Hide whitespace changes
Inline
Side-by-side
include/boost/exception/errinfo_filesystem_path.hpp
0 → 100644
View file @
6938bbd6
// Copyright (C) 2020 Samuel Debionne, ESRF.
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#pragma once
#include
<filesystem>
namespace
boost
{
template
<
class
Tag
,
class
T
>
class
error_info
;
typedef
error_info
<
struct
errinfo_filesystem_path_
,
std
::
filesystem
::
path
>
errinfo_filesystem_path
;
}
include/lima/io/h5/reader.hpp
View file @
6938bbd6
...
...
@@ -8,8 +8,6 @@
#include
<filesystem>
#include
<boost/exception/errinfo_errno.hpp>
#include
<boost/exception/errinfo_file_name.hpp>
#include
<boost/gil/extension/dynamic_image/dynamic_image_all.hpp>
#include
<hdf5.h>
...
...
@@ -22,16 +20,6 @@
#include
<lima/io/h5/params.hpp>
#include
<lima/io/h5/nexus.hpp>
namespace
boost
{
template
<
class
Tag
,
class
T
>
class
error_info
;
typedef
error_info
<
struct
errinfo_filesystem_path_
,
std
::
filesystem
::
path
>
errinfo_filesystem_path
;
typedef
error_info
<
struct
errinfo_h5_path_
,
lima
::
io
::
h5
::
path
>
errinfo_h5_path
;
typedef
error_info
<
struct
errinfo_frame_idx_
,
hsize_t
>
errinfo_frame_idx
;
}
// namespace boost
namespace
lima
{
namespace
io
::
h5
...
...
@@ -118,7 +106,7 @@ namespace io::h5
{
if
(
frame_idx
>=
m_frame_slice
.
count
)
LIMA_THROW_EXCEPTION
(
lima
::
hdf5_error
(
"Frame number out of bound"
)
<<
boost
::
errinfo_
frame
_idx
(
frame_idx
));
<<
boost
::
errinfo_
h5
_idx
(
frame_idx
));
else
if
(
v
.
dimensions
()
!=
m_frame_dims
)
LIMA_THROW_EXCEPTION
(
lima
::
hdf5_error
(
"Frame dimensions mismatch"
));
...
...
include/lima/io/h5/wrapper.hpp
View file @
6938bbd6
...
...
@@ -10,13 +10,13 @@
#include
<string>
#include
<type_traits>
#include
<boost/exception/errinfo_errno.hpp>
#include
<boost/utility/base_from_member.hpp>
#include
<lima/exceptions.hpp>
#include
<lima/utils/lengthof.hpp>
#include
<lima/io/h5/wrapper/base.hpp>
#include
<lima/io/h5/wrapper/errinfo.hpp>
#include
<lima/io/h5/wrapper/link.hpp>
namespace
lima
...
...
include/lima/io/h5/wrapper/errinfo.hpp
0 → 100644
View file @
6938bbd6
// Copyright (C) 2020 Samuel Debionne, ESRF.
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#pragma once
#include
<sstream>
#include
<boost/exception/errinfo_errno.hpp>
#include
<boost/exception/errinfo_file_name.hpp>
#include
<boost/exception/errinfo_filesystem_path.hpp>
#include
<lima/io/h5/wrapper/path.hpp>
namespace
boost
{
using
errinfo_h5_idx
=
error_info
<
struct
errinfo_h5_idx_
,
hsize_t
>
;
using
errinfo_h5_path
=
error_info
<
struct
errinfo_h5_path_
,
lima
::
io
::
h5
::
path
>
;
using
errinfo_h5_stack
=
error_info
<
struct
errinfo_h5_stack_
,
std
::
string
>
;
}
// namespace boost
include/lima/io/h5/writer.hpp
View file @
6938bbd6
...
...
@@ -12,8 +12,6 @@
#include
<optional>
#include
<filesystem>
#include
<boost/exception/errinfo_errno.hpp>
#include
<boost/exception/errinfo_file_name.hpp>
#include
<boost/gil.hpp>
#include
<boost/gil/io/dynamic_io_new.hpp>
...
...
@@ -38,16 +36,6 @@
#include
<lima/io/h5/nexus.hpp>
#include
<lima/io/h5/params.hpp>
namespace
boost
{
template
<
class
Tag
,
class
T
>
class
error_info
;
typedef
error_info
<
struct
errinfo_filesystem_path_
,
std
::
filesystem
::
path
>
errinfo_filesystem_path
;
typedef
error_info
<
struct
errinfo_frame_idx_
,
hsize_t
>
errinfo_frame_idx
;
}
// namespace boost
namespace
lima
{
namespace
io
...
...
@@ -291,7 +279,7 @@ namespace io
{
if
(
frame_idx
>=
m_nb_frames
)
LIMA_THROW_EXCEPTION
(
lima
::
hdf5_error
(
"Frame number out of bound"
)
<<
boost
::
errinfo_
frame
_idx
(
frame_idx
));
<<
boost
::
errinfo_
h5
_idx
(
frame_idx
));
hsize_t
offset
[]
=
{
frame_idx
,
0U
,
0U
};
uint32_t
filter_mask
=
0
;
...
...
@@ -635,7 +623,7 @@ namespace io
// The dimension of the frame_idx dataset is (nb_frames + 1)
if
(
frame_idx
>
m_nb_frames
)
LIMA_THROW_EXCEPTION
(
lima
::
hdf5_error
(
"Frame number out of bound"
)
<<
boost
::
errinfo_
frame
_idx
(
frame_idx
));
<<
boost
::
errinfo_
h5
_idx
(
frame_idx
));
hsize_t
dims
[]
=
{
1
};
auto
mem_space
=
dataspace
::
create_simple
(
1
,
dims
);
...
...
@@ -716,7 +704,7 @@ namespace io
{
if
(
frame_idx
>=
m_nb_frames
)
LIMA_THROW_EXCEPTION
(
lima
::
hdf5_error
(
"Frame number out of bound"
)
<<
boost
::
errinfo_
frame
_idx
(
frame_idx
));
<<
boost
::
errinfo_
h5
_idx
(
frame_idx
));
hsize_t
dims
[]
=
{
m_nb_bins
};
auto
mem_space
=
dataspace
::
create_simple
(
1
,
dims
);
...
...
@@ -735,7 +723,7 @@ namespace io
{
if
(
frame_idx
>=
m_nb_frames
)
LIMA_THROW_EXCEPTION
(
lima
::
hdf5_error
(
"Frame number out of bound"
)
<<
boost
::
errinfo_
frame
_idx
(
frame_idx
));
<<
boost
::
errinfo_
h5
_idx
(
frame_idx
));
hsize_t
dims
[]
=
{
m_nb_bins
};
auto
mem_space
=
dataspace
::
create_simple
(
1
,
dims
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment