45#ifndef TEUCHOS_SERIALIZATION_TRAITS_HPP
46#define TEUCHOS_SERIALIZATION_TRAITS_HPP
52#ifdef HAVE_TEUCHOSCORE_QUADMATH
57#include <qd/dd_real.h>
58#include <qd/qd_real.h>
72 static inline T notDefined() {
return(T::this_type_is_missing_a_specialization());}
129template <
typename Ordinal,
typename T>
275template <
typename Ordinal,
typename T>
310template <
typename Ordinal,
typename T>
316 {
return sizeof(
T)*count; }
318 {
return reinterpret_cast<char*
>(ptr); }
320 {
return reinterpret_cast<const char*
>(ptr); }
322 {
return count/
sizeof(
T); }
324 {
return reinterpret_cast<T*
>(ptr); }
326 {
return reinterpret_cast<const T*
>(ptr); }
362template<
typename Ordinal>
367template<
typename Ordinal>
372template<
typename Ordinal>
377template<
typename Ordinal>
382template<
typename Ordinal>
387template<
typename Ordinal>
392template<
typename Ordinal>
397template<
typename Ordinal>
402template<
typename Ordinal>
407template<
typename Ordinal>
412template<
typename Ordinal>
417#ifdef HAVE_TEUCHOS_LONG_DOUBLE
418template<
typename Ordinal>
426template<
typename Ordinal,
typename P1,
typename P2>
431#ifdef HAVE_TEUCHOSCORE_QUADMATH
432template<
typename Ordinal>
438#ifdef HAVE_TEUCHOS_QD
439template<
typename Ordinal>
440class SerializationTraits<Ordinal,dd_real>
441 :
public DirectSerializationTraits<Ordinal,dd_real>
444template<
typename Ordinal>
445class SerializationTraits<Ordinal,qd_real>
446 :
public DirectSerializationTraits<Ordinal,qd_real>
450#ifdef HAVE_TEUCHOS_COMPLEX
452template<
typename Ordinal>
453class SerializationTraits<Ordinal,
std::complex<float> >
454 :
public DirectSerializationTraits<Ordinal,std::complex<float> >
457template<
typename Ordinal>
458class SerializationTraits<Ordinal,
std::complex<double> >
459 :
public DirectSerializationTraits<Ordinal,std::complex<double> >
469template<
typename Ordinal>
479template<
typename Ordinal>
Teuchos header file which uses auto-configuration information to include necessary C++ headers.
Standard test and throw macros.
Serialization traits for objects that support direct serialization.
static T * convertFromCharPtr(char *ptr)
static Ordinal fromCountToDirectBytes(const Ordinal count)
static char * convertToCharPtr(T *ptr)
static const char * convertToCharPtr(const T *ptr)
static void deserialize(const Ordinal bytes, const char charBuffer[], const Ordinal count, T buffer[])
static Ordinal fromCountToIndirectBytes(const Ordinal count, const T buffer[])
static const T * convertFromCharPtr(const char *ptr)
static Ordinal fromIndirectBytesToCount(const Ordinal bytes, const char charBuffer[])
static void serialize(const Ordinal count, const T buffer[], const Ordinal bytes, char charBuffer[])
static Ordinal fromDirectBytesToCount(const Ordinal count)
static const bool supportsDirectSerialization
Concrete serial communicator subclass.
Serialization traits class for types T that use value semantics.
static const bool supportsDirectSerialization
Whether the type T supports direct serialization.
static void serialize(const Ordinal count, const T buffer[], const Ordinal bytes, char charBuffer[])
Serialize to an indirect char[] buffer.
static Ordinal fromIndirectBytesToCount(const Ordinal bytes, const char charBuffer[])
Return the number of objects for bytes of storage.
static Ordinal fromCountToDirectBytes(const Ordinal count)
Return the number of bytes for count objects.
static Ordinal fromDirectBytesToCount(const Ordinal bytes)
Return the number of objects for bytes of storage.
static void deserialize(const Ordinal bytes, const char charBuffer[], const Ordinal count, T buffer[])
Deserialize from an indirect char[] buffer.
static char * convertToCharPtr(T *ptr)
Convert the pointer type to char*.
static T * convertFromCharPtr(char *ptr)
Convert the pointer type from char*.
static const char * convertToCharPtr(const T *ptr)
Convert the pointer type to const char*.
static const T * convertFromCharPtr(const char *ptr)
Convert the pointer type from char*.
static Ordinal fromCountToIndirectBytes(const Ordinal count, const T buffer[])
Return the number of bytes for count objects.
Serialization class for types T that use value semantics.
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
This macro is designed to be a short version of TEUCHOS_TEST_FOR_EXCEPTION() that is easier to call.
Report an error if a specialization of SerializationTraits is missing.
static T notDefined()
This function should not compile if there is an attempt to instantiate!