Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
Teuchos::Serializer< Ordinal, T > Class Template Referenceabstract

Strategy interface for the indirect serializing and deserializing objects of a given type handled using reference semantics. More...

#include <Teuchos_Serializer.hpp>

Public Member Functions

virtual ~Serializer ()
 
virtual Ordinal getBufferSize (const Ordinal count) const =0
 Return an estimate for the maximum storage for count objects to be serialized. More...
 
virtual void serialize (const Ordinal count, const T *const objs[], const Ordinal bytes, char charBuffer[]) const =0
 Serialize an object to a char[] buffer. More...
 
virtual RCP< T > createObj () const =0
 Create an object of type T to be serialized into. More...
 
virtual void deserialize (const Ordinal bytes, const char charBuffer[], const Ordinal count, T *const objs[]) const =0
 Deserialize an object from a char[] buffer. More...
 

Detailed Description

template<typename Ordinal, typename T>
class Teuchos::Serializer< Ordinal, T >

Strategy interface for the indirect serializing and deserializing objects of a given type handled using reference semantics.

This interface serializes and deserializes objects of type T to and from independent char[] buffer arrays. Direct serialization (i.e. just using reinterpret casts) is not possible using this interface.

Definition at line 57 of file Teuchos_Serializer.hpp.

Constructor & Destructor Documentation

template<typename Ordinal, typename T>
virtual Teuchos::Serializer< Ordinal, T >::~Serializer ( )
inlinevirtual

Definition at line 61 of file Teuchos_Serializer.hpp.

Member Function Documentation

template<typename Ordinal, typename T>
virtual Ordinal Teuchos::Serializer< Ordinal, T >::getBufferSize ( const Ordinal  count) const
pure virtual

Return an estimate for the maximum storage for count objects to be serialized.

template<typename Ordinal, typename T>
virtual void Teuchos::Serializer< Ordinal, T >::serialize ( const Ordinal  count,
const T *const  objs[],
const Ordinal  bytes,
char  charBuffer[] 
) const
pure virtual

Serialize an object to a char[] buffer.

Parameters
count[in] Number of objects to be serialized.
objs[in] Array (length count) for the objects to be serialized.
bytes[in] Length of the buffer charBuffer[]
charBuffer[out] Array (length bytes) that contains the serialized objects.

Preconditions:

  • count > 0
  • objs != NULL
  • charBuffer != NULL bytes == getBufferSize(count)
template<typename Ordinal, typename T>
virtual RCP<T> Teuchos::Serializer< Ordinal, T >::createObj ( ) const
pure virtual

Create an object of type T to be serialized into.

template<typename Ordinal, typename T>
virtual void Teuchos::Serializer< Ordinal, T >::deserialize ( const Ordinal  bytes,
const char  charBuffer[],
const Ordinal  count,
T *const  objs[] 
) const
pure virtual

Deserialize an object from a char[] buffer.

Parameters
bytes[in] Length of the buffer charBuffer[]
charBuffer[in] Array (length bytes) that contains the serialized objects.
count[in] Number of objects to be deserialized.
objs[out] Array (length count) for the deserialized objects.

Preconditions:

  • bytes > 0
  • objs != NULL
  • charBuffer != NULL bytes == getBufferSize(count)

The documentation for this class was generated from the following file: