modifications for g47 and comment out memory intensive testing

This commit is contained in:
Shane Grant 2017-05-03 11:38:35 -07:00
parent c4dcc8d5de
commit f031131130
2 changed files with 112 additions and 102 deletions

View File

@ -215,6 +215,14 @@ namespace cereal
#undef UNREGISTERED_POLYMORPHIC_CAST_EXCEPTION
};
#ifdef CEREAL_OLDER_GCC
#define CEREAL_EMPLACE_MAP(map, key, value) \
map.insert( std::make_pair(std::move(key), std::move(value)) );
#else // NOT CEREAL_OLDER_GCC
#define CEREAL_EMPLACE_MAP(map, key, value) \
map.emplace( key, value );
#endif // NOT_CEREAL_OLDER_GCC
//! Strongly typed derivation of PolymorphicCaster
template <class Base, class Derived>
struct PolymorphicVirtualCaster : PolymorphicCaster
@ -240,7 +248,7 @@ namespace cereal
// Insert reverse relation Derived->Base
auto & reverseMap = StaticObject<PolymorphicCasters>::getInstance().reverseMap;
reverseMap.emplace( derivedKey, baseKey );
CEREAL_EMPLACE_MAP(reverseMap, derivedKey, baseKey);
// Find all chainable unregistered relations
/* The strategy here is to process only the nodes in the class hierarchy graph that have been
@ -352,7 +360,7 @@ namespace cereal
{
auto & derivedMap = baseMap.find( it.first )->second;
derivedMap[it.second.first] = it.second.second;
reverseMap.emplace( it.second.first, it.first );
CEREAL_EMPLACE_MAP(reverseMap, it.second.first, it.first );
}
// Mark current parent as modified
@ -373,6 +381,8 @@ namespace cereal
} // end chainable relations
} // end PolymorphicVirtualCaster()
#undef CEREAL_EMPLACE_MAP
//! Performs the proper downcast with the templated types
void const * downcast( void const * const ptr ) const override
{

View File

@ -493,106 +493,106 @@ CEREAL_REGISTER_TYPE(Derived)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived97,Derived98)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived98,Derived99)
CEREAL_TEST_CREATE_DERIVED_CLASS(Object,Derived0)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived0,Derived1)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived1,Derived2)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived2,Derived3)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived0,Derived4)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived4,Derived5)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived5,Derived6)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived0,Derived7)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived7,Derived8)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived8,Derived9)
CEREAL_TEST_CREATE_DERIVED_CLASS(Object,Derived10)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived10,Derived11)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived11,Derived12)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived12,Derived13)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived10,Derived14)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived14,Derived15)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived15,Derived16)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived10,Derived17)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived17,Derived18)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived18,Derived19)
CEREAL_TEST_CREATE_DERIVED_CLASS(Object,Derived20)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived20,Derived21)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived21,Derived22)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived22,Derived23)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived20,Derived24)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived24,Derived25)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived25,Derived26)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived20,Derived27)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived27,Derived28)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived28,Derived29)
CEREAL_TEST_CREATE_DERIVED_CLASS(Object,Derived30)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived30,Derived31)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived31,Derived32)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived32,Derived33)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived30,Derived34)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived34,Derived35)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived35,Derived36)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived30,Derived37)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived37,Derived38)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived38,Derived39)
CEREAL_TEST_CREATE_DERIVED_CLASS(Object,Derived40)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived40,Derived41)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived41,Derived42)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived42,Derived43)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived40,Derived44)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived44,Derived45)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived45,Derived46)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived40,Derived47)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived47,Derived48)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived48,Derived49)
CEREAL_TEST_CREATE_DERIVED_CLASS(Object,Derived50)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived50,Derived51)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived51,Derived52)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived52,Derived53)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived50,Derived54)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived54,Derived55)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived55,Derived56)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived50,Derived57)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived57,Derived58)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived58,Derived59)
CEREAL_TEST_CREATE_DERIVED_CLASS(Object,Derived60)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived60,Derived61)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived61,Derived62)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived62,Derived63)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived60,Derived64)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived64,Derived65)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived65,Derived66)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived60,Derived67)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived67,Derived68)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived68,Derived69)
CEREAL_TEST_CREATE_DERIVED_CLASS(Object,Derived70)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived70,Derived71)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived71,Derived72)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived72,Derived73)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived70,Derived74)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived74,Derived75)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived75,Derived76)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived70,Derived77)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived77,Derived78)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived78,Derived79)
CEREAL_TEST_CREATE_DERIVED_CLASS(Object,Derived80)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived80,Derived81)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived81,Derived82)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived82,Derived83)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived80,Derived84)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived84,Derived85)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived85,Derived86)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived80,Derived87)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived87,Derived88)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived88,Derived89)
CEREAL_TEST_CREATE_DERIVED_CLASS(Object,Derived90)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived90,Derived91)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived91,Derived92)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived92,Derived93)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived90,Derived94)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived94,Derived95)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived95,Derived96)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived90,Derived97)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived97,Derived98)
CEREAL_TEST_CREATE_DERIVED_CLASS(Derived98,Derived99)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Object,Derived0)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived0,Derived1)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived1,Derived2)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived2,Derived3)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived0,Derived4)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived4,Derived5)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived5,Derived6)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived0,Derived7)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived7,Derived8)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived8,Derived9)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Object,Derived10)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived10,Derived11)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived11,Derived12)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived12,Derived13)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived10,Derived14)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived14,Derived15)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived15,Derived16)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived10,Derived17)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived17,Derived18)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived18,Derived19)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Object,Derived20)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived20,Derived21)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived21,Derived22)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived22,Derived23)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived20,Derived24)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived24,Derived25)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived25,Derived26)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived20,Derived27)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived27,Derived28)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived28,Derived29)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Object,Derived30)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived30,Derived31)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived31,Derived32)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived32,Derived33)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived30,Derived34)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived34,Derived35)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived35,Derived36)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived30,Derived37)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived37,Derived38)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived38,Derived39)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Object,Derived40)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived40,Derived41)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived41,Derived42)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived42,Derived43)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived40,Derived44)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived44,Derived45)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived45,Derived46)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived40,Derived47)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived47,Derived48)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived48,Derived49)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Object,Derived50)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived50,Derived51)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived51,Derived52)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived52,Derived53)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived50,Derived54)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived54,Derived55)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived55,Derived56)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived50,Derived57)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived57,Derived58)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived58,Derived59)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Object,Derived60)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived60,Derived61)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived61,Derived62)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived62,Derived63)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived60,Derived64)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived64,Derived65)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived65,Derived66)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived60,Derived67)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived67,Derived68)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived68,Derived69)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Object,Derived70)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived70,Derived71)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived71,Derived72)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived72,Derived73)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived70,Derived74)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived74,Derived75)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived75,Derived76)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived70,Derived77)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived77,Derived78)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived78,Derived79)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Object,Derived80)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived80,Derived81)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived81,Derived82)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived82,Derived83)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived80,Derived84)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived84,Derived85)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived85,Derived86)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived80,Derived87)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived87,Derived88)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived88,Derived89)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Object,Derived90)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived90,Derived91)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived91,Derived92)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived92,Derived93)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived90,Derived94)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived94,Derived95)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived95,Derived96)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived90,Derived97)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived97,Derived98)
//CEREAL_TEST_CREATE_DERIVED_CLASS(Derived98,Derived99)
#endif // CEREAL_TEST_POLYMORPHIC_H_