#include "INestedMarshaller.h" #if defined(MARSHALSUPPORT_CPP11SUPPORTED) && !defined(MARSHALSUPPORT_NOVARIADICTEMPLATES) #include "TupleHelper.h" #endif namespace MarshalSupport { namespace Internal { //---------------------------------------------------------------------------------------------------------------------- template void EnsureSTLContainerKeySizesMatch(INestedMarshallerBase* const nestedMarshallerArray[], size_t nestedMarshallerArrayIndex, const std::vector* elementPointer) { EnsureSTLContainerKeySizesMatch(nestedMarshallerArray, nestedMarshallerArrayIndex+1, (const ElementType*)elementPointer); } #ifdef MARSHALSUPPORT_CPP11SUPPORTED //---------------------------------------------------------------------------------------------------------------------- template void EnsureSTLContainerKeySizesMatch(INestedMarshallerBase* const nestedMarshallerArray[], size_t nestedMarshallerArrayIndex, const std::array* elementPointer) { EnsureSTLContainerKeySizesMatch(nestedMarshallerArray, nestedMarshallerArrayIndex+1, (const ElementType*)elementPointer); } #endif //---------------------------------------------------------------------------------------------------------------------- template void EnsureSTLContainerKeySizesMatch(INestedMarshallerBase* const nestedMarshallerArray[], size_t nestedMarshallerArrayIndex, const std::list* elementPointer) { EnsureSTLContainerKeySizesMatch(nestedMarshallerArray, nestedMarshallerArrayIndex+1, (const ElementType*)elementPointer); } #ifdef MARSHALSUPPORT_CPP11SUPPORTED //---------------------------------------------------------------------------------------------------------------------- template void EnsureSTLContainerKeySizesMatch(INestedMarshallerBase* const nestedMarshallerArray[], size_t nestedMarshallerArrayIndex, const std::forward_list* elementPointer) { EnsureSTLContainerKeySizesMatch(nestedMarshallerArray, nestedMarshallerArrayIndex+1, (const ElementType*)elementPointer); } #endif //---------------------------------------------------------------------------------------------------------------------- template void EnsureSTLContainerKeySizesMatch(INestedMarshallerBase* const nestedMarshallerArray[], size_t nestedMarshallerArrayIndex, const std::deque* elementPointer) { EnsureSTLContainerKeySizesMatch(nestedMarshallerArray, nestedMarshallerArrayIndex+1, (const ElementType*)elementPointer); } //---------------------------------------------------------------------------------------------------------------------- template void EnsureSTLContainerKeySizesMatch(INestedMarshallerBase* const nestedMarshallerArray[], size_t nestedMarshallerArrayIndex, const std::set* elementPointer) { EnsureSTLContainerKeySizesMatch(nestedMarshallerArray, nestedMarshallerArrayIndex+1, (const ElementType*)elementPointer); } //---------------------------------------------------------------------------------------------------------------------- template void EnsureSTLContainerKeySizesMatch(INestedMarshallerBase* const nestedMarshallerArray[], size_t nestedMarshallerArrayIndex, const std::multiset* elementPointer) { EnsureSTLContainerKeySizesMatch(nestedMarshallerArray, nestedMarshallerArrayIndex+1, (const ElementType*)elementPointer); } #ifdef MARSHALSUPPORT_CPP11SUPPORTED //---------------------------------------------------------------------------------------------------------------------- template void EnsureSTLContainerKeySizesMatch(INestedMarshallerBase* const nestedMarshallerArray[], size_t nestedMarshallerArrayIndex, const std::unordered_set* elementPointer) { EnsureSTLContainerKeySizesMatch(nestedMarshallerArray, nestedMarshallerArrayIndex+1, (const ElementType*)elementPointer); } //---------------------------------------------------------------------------------------------------------------------- template void EnsureSTLContainerKeySizesMatch(INestedMarshallerBase* const nestedMarshallerArray[], size_t nestedMarshallerArrayIndex, const std::unordered_multiset* elementPointer) { EnsureSTLContainerKeySizesMatch(nestedMarshallerArray, nestedMarshallerArrayIndex+1, (const ElementType*)elementPointer); } #endif //---------------------------------------------------------------------------------------------------------------------- template void EnsureSTLContainerKeySizesMatch(INestedMarshallerBase* const nestedMarshallerArray[], size_t nestedMarshallerArrayIndex, const std::map* elementPointer) { const INestedMarshaller* keyMarshaller = (const INestedMarshaller*)nestedMarshallerArray[nestedMarshallerArrayIndex]; keyMarshaller->EnsureSizeMatch(sizeof(KeyType)); EnsureSTLContainerKeySizesMatch(nestedMarshallerArray, nestedMarshallerArrayIndex+1, (const ElementType*)elementPointer); } //---------------------------------------------------------------------------------------------------------------------- template void EnsureSTLContainerKeySizesMatch(INestedMarshallerBase* const nestedMarshallerArray[], size_t nestedMarshallerArrayIndex, const std::multimap* elementPointer) { const INestedMarshaller* keyMarshaller = (const INestedMarshaller*)nestedMarshallerArray[nestedMarshallerArrayIndex]; keyMarshaller->EnsureSizeMatch(sizeof(KeyType)); EnsureSTLContainerKeySizesMatch(nestedMarshallerArray, nestedMarshallerArrayIndex+1, (const ElementType*)elementPointer); } #ifdef MARSHALSUPPORT_CPP11SUPPORTED //---------------------------------------------------------------------------------------------------------------------- template void EnsureSTLContainerKeySizesMatch(INestedMarshallerBase* const nestedMarshallerArray[], size_t nestedMarshallerArrayIndex, const std::unordered_map* elementPointer) { const INestedMarshaller* keyMarshaller = (const INestedMarshaller*)nestedMarshallerArray[nestedMarshallerArrayIndex]; keyMarshaller->EnsureSizeMatch(sizeof(KeyType)); EnsureSTLContainerKeySizesMatch(nestedMarshallerArray, nestedMarshallerArrayIndex+1, (const ElementType*)elementPointer); } //---------------------------------------------------------------------------------------------------------------------- template void EnsureSTLContainerKeySizesMatch(INestedMarshallerBase* const nestedMarshallerArray[], size_t nestedMarshallerArrayIndex, const std::unordered_multimap* elementPointer) { const INestedMarshaller* keyMarshaller = (const INestedMarshaller*)nestedMarshallerArray[nestedMarshallerArrayIndex]; keyMarshaller->EnsureSizeMatch(sizeof(KeyType)); EnsureSTLContainerKeySizesMatch(nestedMarshallerArray, nestedMarshallerArrayIndex+1, (const ElementType*)elementPointer); } #endif //---------------------------------------------------------------------------------------------------------------------- template void EnsureSTLContainerKeySizesMatch(INestedMarshallerBase* const nestedMarshallerArray[], size_t nestedMarshallerArrayIndex, const std::stack* elementPointer) { EnsureSTLContainerKeySizesMatch(nestedMarshallerArray, nestedMarshallerArrayIndex+1, (const ElementType*)elementPointer); } //---------------------------------------------------------------------------------------------------------------------- template void EnsureSTLContainerKeySizesMatch(INestedMarshallerBase* const nestedMarshallerArray[], size_t nestedMarshallerArrayIndex, const std::queue* elementPointer) { EnsureSTLContainerKeySizesMatch(nestedMarshallerArray, nestedMarshallerArrayIndex+1, (const ElementType*)elementPointer); } //---------------------------------------------------------------------------------------------------------------------- template void EnsureSTLContainerKeySizesMatch(INestedMarshallerBase* const nestedMarshallerArray[], size_t nestedMarshallerArrayIndex, const std::priority_queue* elementPointer) { EnsureSTLContainerKeySizesMatch(nestedMarshallerArray, nestedMarshallerArrayIndex+1, (const ElementType*)elementPointer); } //---------------------------------------------------------------------------------------------------------------------- template void EnsureSTLContainerKeySizesMatch(INestedMarshallerBase* const nestedMarshallerArray[], size_t nestedMarshallerArrayIndex, const std::basic_string* elementPointer) { EnsureSTLContainerKeySizesMatch(nestedMarshallerArray, nestedMarshallerArrayIndex+1, (const ElementType*)elementPointer); } //---------------------------------------------------------------------------------------------------------------------- template void EnsureSTLContainerKeySizesMatch(INestedMarshallerBase* const nestedMarshallerArray[], size_t nestedMarshallerArrayIndex, const std::pair* elementPointer) { const INestedMarshaller* keyMarshallerT1 = (const INestedMarshaller*)nestedMarshallerArray[nestedMarshallerArrayIndex]; const INestedMarshaller* keyMarshallerT2 = (const INestedMarshaller*)nestedMarshallerArray[nestedMarshallerArrayIndex+1]; keyMarshallerT1->EnsureSizeMatch(sizeof(T1)); keyMarshallerT2->EnsureSizeMatch(sizeof(T2)); } #if defined(MARSHALSUPPORT_CPP11SUPPORTED) && !defined(MARSHALSUPPORT_NOVARIADICTEMPLATES) //---------------------------------------------------------------------------------------------------------------------- void EnsureSTLContainerKeySizesMatch(INestedMarshallerBase* const nestedMarshallerArray[], size_t nestedMarshallerArrayIndex, const std::tuple<>* elementPointer) { } //---------------------------------------------------------------------------------------------------------------------- template void EnsureSTLContainerKeySizesMatch(INestedMarshallerBase* const nestedMarshallerArray[], size_t nestedMarshallerArrayIndex, const std::tuple* elementPointer) { TupleHelper>::value-1, Args...>::EnsureSTLContainerKeySizesMatch(nestedMarshallerArray, nestedMarshallerArrayIndex, elementPointer); } //---------------------------------------------------------------------------------------------------------------------- template void TupleHelper::EnsureSTLContainerKeySizesMatch(INestedMarshallerBase* const nestedMarshallerArray[], size_t nestedMarshallerArrayIndex, const std::tuple* elementPointer) { const INestedMarshaller>::type>* keyMarshaller = (const INestedMarshaller>::type>*)nestedMarshallerArray[nestedMarshallerArrayIndex]; keyMarshaller->EnsureSizeMatch(sizeof(typename std::tuple_element>::type)); TupleHelper::EnsureSTLContainerKeySizesMatch(nestedMarshallerArray, nestedMarshallerArrayIndex+1, elementPointer); } //---------------------------------------------------------------------------------------------------------------------- template void TupleHelper<0, Args...>::EnsureSTLContainerKeySizesMatch(INestedMarshallerBase* const nestedMarshallerArray[], size_t nestedMarshallerArrayIndex, const std::tuple* elementPointer) { const INestedMarshaller>::type>* keyMarshaller = (const INestedMarshaller>::type>*)nestedMarshallerArray[nestedMarshallerArrayIndex]; keyMarshaller->EnsureSizeMatch(sizeof(typename std::tuple_element<0, std::tuple>::type)); } #endif //---------------------------------------------------------------------------------------------------------------------- template void EnsureSTLContainerKeySizesMatch(INestedMarshallerBase* const nestedMarshallerArray[], size_t nestedMarshallerArrayIndex, const ElementType* elementPointer) { } } // Close namespace Internal } // Close namespace MarshalSupport