|
Teuchos Package Browser (Single Doxygen Collection)
Version of the Day
|
Go to the documentation of this file.
45 #ifndef TEUCHOS_SERIALIZATION_TRAITS_HPP
46 #define TEUCHOS_SERIALIZATION_TRAITS_HPP
52 #ifdef HAVE_TEUCHOSCORE_QUADMATH
54 #endif // HAVE_TEUCHOSCORE_QUADMATH
56 #ifdef HAVE_TEUCHOS_QD
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());}
129 template <
typename Ordinal,
typename T>
197 (void)count; (void)buffer;
222 (void)count; (void)buffer; (void)bytes; (void)charBuffer;
228 const char charBuffer[]) {
229 (void)bytes; (void)charBuffer;
250 const char charBuffer[],
254 (void)bytes; (void)charBuffer; (void)count; (void)buffer;
275 template <
typename Ordinal,
typename T>
310 template <
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); }
331 const Ordinal count,
const T buffer[],
const Ordinal bytes,
char charBuffer[]
338 std::copy(_buffer,_buffer+bytes,charBuffer);
341 const char charBuffer[])
344 const Ordinal bytes,
const char charBuffer[],
const Ordinal count, T buffer[]
351 std::copy(charBuffer,charBuffer+bytes,_buffer);
360 template<
typename Ordinal>
365 template<
typename Ordinal>
370 template<
typename Ordinal>
375 template<
typename Ordinal>
380 template<
typename Ordinal>
385 template<
typename Ordinal>
390 template<
typename Ordinal>
395 template<
typename Ordinal>
400 template<
typename Ordinal>
405 template<
typename Ordinal>
410 template<
typename Ordinal>
416 template<
typename Ordinal,
typename P1,
typename P2>
421 #ifdef HAVE_TEUCHOSCORE_QUADMATH
422 template<
typename Ordinal>
426 #endif // HAVE_TEUCHOSCORE_QUADMATH
428 #ifdef HAVE_TEUCHOS_QD
429 template<
typename Ordinal>
430 class SerializationTraits<Ordinal,dd_real>
431 :
public DirectSerializationTraits<Ordinal,dd_real>
434 template<
typename Ordinal>
435 class SerializationTraits<Ordinal,qd_real>
436 :
public DirectSerializationTraits<Ordinal,qd_real>
440 #ifdef HAVE_TEUCHOS_COMPLEX
442 template<
typename Ordinal>
443 class SerializationTraits<Ordinal,
std::complex<float> >
444 :
public DirectSerializationTraits<Ordinal,std::complex<float> >
447 template<
typename Ordinal>
448 class SerializationTraits<Ordinal,
std::complex<double> >
449 :
public DirectSerializationTraits<Ordinal,std::complex<double> >
452 #endif // HAVE_TEUCHOS_COMPLEX
459 template<
typename Ordinal>
469 template<
typename Ordinal>
476 #endif // TEUCHOS_SERIALIZATION_TRAITS_HPP
static T notDefined()
This function should not compile if there is an attempt to instantiate!
static const T * convertFromCharPtr(const char *ptr)
Convert the pointer type from char*.
#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.
static void deserialize(const Ordinal bytes, const char charBuffer[], const Ordinal count, T buffer[])
Deserialize from an indirect char[] buffer.
Serialization class for types T that use value semantics.
static const T * convertFromCharPtr(const char *ptr)
Standard test and throw macros.
static Ordinal fromDirectBytesToCount(const Ordinal count)
static const bool supportsDirectSerialization
static Ordinal fromDirectBytesToCount(const Ordinal bytes)
Return the number of objects for bytes of storage.
Report an error if a specialization of SerializationTraits is missing.
static char * convertToCharPtr(T *ptr)
static T * convertFromCharPtr(char *ptr)
Convert the pointer type from char*.
static Ordinal fromCountToDirectBytes(const Ordinal count)
Return the number of bytes for count objects.
static void serialize(const Ordinal count, const T buffer[], const Ordinal bytes, char charBuffer[])
static Ordinal fromCountToDirectBytes(const Ordinal count)
static Ordinal fromCountToIndirectBytes(const Ordinal count, const T buffer[])
static void serialize(const Ordinal count, const T buffer[], const Ordinal bytes, char charBuffer[])
Serialize to an indirect char[] buffer.
static T * convertFromCharPtr(char *ptr)
Teuchos header file which uses auto-configuration information to include necessary C++ headers.
static void deserialize(const Ordinal bytes, const char charBuffer[], const Ordinal count, T buffer[])
Serialization traits for objects that support direct serialization.
static const char * convertToCharPtr(const T *ptr)
Convert the pointer type to const char*.
Serialization traits class for types T that use value semantics.
static Ordinal fromIndirectBytesToCount(const Ordinal bytes, const char charBuffer[])
Return the number of objects for bytes of storage.
static char * convertToCharPtr(T *ptr)
Convert the pointer type to char*.
static const char * convertToCharPtr(const T *ptr)
static Ordinal fromCountToIndirectBytes(const Ordinal count, const T buffer[])
Return the number of bytes for count objects.
static const bool supportsDirectSerialization
Whether the type T supports direct serialization.
static Ordinal fromIndirectBytesToCount(const Ordinal bytes, const char charBuffer[])