Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:USCiLab/cereal into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
AzothAmmo committed Mar 29, 2015
2 parents 14bc429 + 16084f7 commit aad1e37
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 72 deletions.
2 changes: 1 addition & 1 deletion include/cereal/access.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ namespace cereal
@code{cpp}
struct MyType {};
CEREAL_SPECIALIZE_FOR_ALL_ARCHIVES( cereal::XMLInputArchive, MyType, cereal::specialization::member_load_save );
CEREAL_SPECIALIZE_FOR_ARCHIVE( cereal::XMLInputArchive, MyType, cereal::specialization::member_load_save );
@endcode
@relates specialize
Expand Down
7 changes: 7 additions & 0 deletions include/cereal/archives/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,13 @@ namespace cereal
++itsIteratorStack.back();
}

//! Retrieves the current node name
/*! @return nullptr if no name exists */
const char * getNodeName() const
{
return itsIteratorStack.back().name();
}

//! Sets the name for the next node created with startNode
void setNextName( const char * name )
{
Expand Down
7 changes: 7 additions & 0 deletions include/cereal/archives/xml.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,13 @@ namespace cereal
itsNodes.top().name = nullptr;
}

//! Retrieves the current node name
//! will return @c nullptr if the node does not have a name
const char * getNodeName() const
{
return itsNodes.top().node->name();
}

//! Sets the name for the next node created with startNode
void setNextName( const char * name )
{
Expand Down
4 changes: 2 additions & 2 deletions include/cereal/types/polymorphic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
@relates CEREAL_FORCE_DYNAMIC_INIT
*/
#define CEREAL_REGISTER_DYNAMIC_INIT(Name) \
#define CEREAL_REGISTER_DYNAMIC_INIT(LibName) \
namespace cereal { \
namespace detail { \
void CEREAL_DLL_EXPORT dynamic_init_dummy_##LibName() {} \
Expand All @@ -144,7 +144,7 @@
See CEREAL_REGISTER_DYNAMIC_INIT for detailed explanation
of how this macro should be used. The name used should
match that for CEREAL_REGISTER_DYNAMIC_INIT. */
#define CEREAL_FORCE_DYNAMIC_INIT(Name) \
#define CEREAL_FORCE_DYNAMIC_INIT(LibName) \
namespace cereal { \
namespace detail { \
void dynamic_init_dummy_##LibName(); \
Expand Down
2 changes: 1 addition & 1 deletion include/cereal/types/tuple.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace cereal
template <size_t Q, size_t R, char ... C>
struct to_string_impl
{
using type = typename to_string_impl<Q/1, Q%10, R+'0', C...>::type;
using type = typename to_string_impl<Q/10, Q%10, R+'0', C...>::type;
};

//! Base case with no quotient
Expand Down
57 changes: 0 additions & 57 deletions sandbox/sandbox_boostcompat.cpp

This file was deleted.

1 change: 0 additions & 1 deletion sandbox/sandbox_vs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include <cereal/types/array.hpp>
#include <cereal/types/bitset.hpp>
#include <cereal/types/boost_variant.hpp>
#include <cereal/types/chrono.hpp>
#include <cereal/types/common.hpp>
#include <cereal/types/complex.hpp>
Expand Down
26 changes: 16 additions & 10 deletions unittests/tuple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ void test_tuple()
for(int ii=0; ii<100; ++ii)
{
auto o_podtuple = std::make_tuple( rng(), rng(), rng(), rng() );
auto o_podtuple11 = std::make_tuple( rng(), rng(), rng(), rng(), rng(), rng(),
rng(), rng(), rng(), rng(), rng() );
auto o_isertuple = std::make_tuple( StructInternalSerialize( rng(), rng() ),
StructInternalSerialize( rng(), rng() ),
StructInternalSerialize( rng(), rng() ),
Expand All @@ -60,34 +62,38 @@ void test_tuple()
OArchive oar(os);

oar(o_podtuple);
oar(o_podtuple11);
oar(o_isertuple);
oar(o_ispltuple);
oar(o_esertuple);
oar(o_espltuple);
}

decltype( o_podtuple ) i_podtuple;
decltype( o_isertuple ) i_isertuple;
decltype( o_ispltuple ) i_ispltuple;
decltype( o_esertuple ) i_esertuple;
decltype( o_espltuple ) i_espltuple;
decltype( o_podtuple ) i_podtuple;
decltype( o_podtuple11 ) i_podtuple11;
decltype( o_isertuple ) i_isertuple;
decltype( o_ispltuple ) i_ispltuple;
decltype( o_esertuple ) i_esertuple;
decltype( o_espltuple ) i_espltuple;

std::istringstream is(os.str());
{
IArchive iar(is);

iar(i_podtuple);
iar(i_podtuple11);
iar(i_isertuple);
iar(i_ispltuple);
iar(i_esertuple);
iar(i_espltuple);
}

BOOST_CHECK_EQUAL( i_podtuple == o_podtuple, true );
BOOST_CHECK_EQUAL( i_isertuple == o_isertuple, true );
BOOST_CHECK_EQUAL( i_ispltuple == o_ispltuple, true );
BOOST_CHECK_EQUAL( i_esertuple == o_esertuple, true );
BOOST_CHECK_EQUAL( i_espltuple == o_espltuple, true );
BOOST_CHECK_EQUAL( i_podtuple == o_podtuple, true );
BOOST_CHECK_EQUAL( i_podtuple11 == o_podtuple11, true );
BOOST_CHECK_EQUAL( i_isertuple == o_isertuple, true );
BOOST_CHECK_EQUAL( i_ispltuple == o_ispltuple, true );
BOOST_CHECK_EQUAL( i_esertuple == o_esertuple, true );
BOOST_CHECK_EQUAL( i_espltuple == o_espltuple, true );
}
}

Expand Down

0 comments on commit aad1e37

Please sign in to comment.