Skip to content

Commit 8e709d6

Browse files
committed
Feat: make ScribeWrapper inline in XML
1 parent ae69750 commit 8e709d6

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

include/poly-scribe/scribe-wrapper.hpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#define POLY_SCRIBE_SCRIBE_WRAPPER_HPP
1212

1313
#include <cereal/archives/json.hpp>
14+
#include <cereal/archives/xml.hpp>
1415
#include <cereal/cereal.hpp>
1516
#include <string>
1617

@@ -99,6 +100,31 @@ namespace poly_scribe
99100
{
100101
}
101102
/// \}
103+
104+
///
105+
/// \brief Pro- and epilogue functions to ensure that the wrapper is serialized inline for XML archives.
106+
/// \{
107+
///
108+
template<class T>
109+
inline void prologue( cereal::XMLOutputArchive & /*unused*/, ScribeWrapper<T> const & /*unused*/ )
110+
{
111+
}
112+
113+
template<class T>
114+
inline void prologue( cereal::XMLInputArchive & /*unused*/, ScribeWrapper<T> const & /*unused*/ )
115+
{
116+
}
117+
118+
template<class T>
119+
inline void epilogue( cereal::XMLOutputArchive & /*unused*/, ScribeWrapper<T> const & /*unused*/ )
120+
{
121+
}
122+
123+
template<class T>
124+
inline void epilogue( cereal::XMLInputArchive & /*unused*/, ScribeWrapper<T> const & /*unused*/ )
125+
{
126+
}
127+
/// \}
102128
} // namespace poly_scribe
103129

104130
#endif

0 commit comments

Comments
 (0)