Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sds
HEP
HEPnOS
Commits
61ff41b3
Commit
61ff41b3
authored
Jan 31, 2021
by
Matthieu Dorier
Browse files
fixed bug in InputArchive
parent
abc24081
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/hepnos/InputArchive.hpp
View file @
61ff41b3
...
@@ -44,7 +44,9 @@ class InputArchive : public iarchive {
...
@@ -44,7 +44,9 @@ class InputArchive : public iarchive {
template
<
typename
...
Args
>
template
<
typename
...
Args
>
InputArchive
(
DataStore
&&
datastore
,
Args
&&
...
args
)
InputArchive
(
DataStore
&&
datastore
,
Args
&&
...
args
)
:
iarchive
(
std
::
forward
<
Args
>
(
args
)...,
boost
::
archive
::
archive_flags
::
no_header
)
:
iarchive
(
std
::
forward
<
Args
>
(
args
)...,
boost
::
archive
::
archive_flags
::
no_header
)
,
m_datastore
(
std
::
move
(
datastore
))
{}
,
m_datastore
(
std
::
move
(
datastore
))
{
init
(
boost
::
archive
::
archive_flags
::
no_header
);
}
/**
/**
* @brief Constructor.
* @brief Constructor.
...
@@ -56,7 +58,9 @@ class InputArchive : public iarchive {
...
@@ -56,7 +58,9 @@ class InputArchive : public iarchive {
template
<
typename
...
Args
>
template
<
typename
...
Args
>
InputArchive
(
const
DataStore
&
datastore
,
Args
&&
...
args
)
InputArchive
(
const
DataStore
&
datastore
,
Args
&&
...
args
)
:
iarchive
(
std
::
forward
<
Args
>
(
args
)...,
boost
::
archive
::
archive_flags
::
no_header
)
:
iarchive
(
std
::
forward
<
Args
>
(
args
)...,
boost
::
archive
::
archive_flags
::
no_header
)
,
m_datastore
(
datastore
)
{}
,
m_datastore
(
datastore
)
{
init
(
boost
::
archive
::
archive_flags
::
no_header
);
}
/**
/**
* @brief Returns the DataStore used when creating the InputArchive.
* @brief Returns the DataStore used when creating the InputArchive.
...
@@ -69,4 +73,7 @@ class InputArchive : public iarchive {
...
@@ -69,4 +73,7 @@ class InputArchive : public iarchive {
}
}
BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION
(
hepnos
::
InputArchive
)
BOOST_SERIALIZATION_REGISTER_ARCHIVE
(
hepnos
::
InputArchive
)
#endif
#endif
test/TestObjects.hpp
View file @
61ff41b3
...
@@ -37,20 +37,23 @@ class TestObjectB {
...
@@ -37,20 +37,23 @@ class TestObjectB {
int
&
a
()
{
return
_a
;
}
int
&
a
()
{
return
_a
;
}
std
::
string
&
b
()
{
return
_b
;
}
std
::
string
&
b
()
{
return
_b
;
}
std
::
vector
<
char
>&
c
()
{
return
_c
;
}
bool
operator
==
(
const
TestObjectB
&
other
)
const
{
bool
operator
==
(
const
TestObjectB
&
other
)
const
{
return
_a
==
other
.
_a
&&
_b
==
other
.
_b
;
return
_a
==
other
.
_a
&&
_b
==
other
.
_b
&&
_c
==
other
.
_c
;
}
}
private:
private:
int
_a
;
int
_a
;
std
::
string
_b
;
std
::
string
_b
;
std
::
vector
<
char
>
_c
;
template
<
typename
Archive
>
template
<
typename
Archive
>
void
serialize
(
Archive
&
ar
,
const
unsigned
int
version
)
{
void
serialize
(
Archive
&
ar
,
const
unsigned
int
version
)
{
ar
&
_a
;
ar
&
_a
;
ar
&
_b
;
ar
&
_b
;
ar
&
_c
;
}
}
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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