Teuchos - Trilinos Tools Package Version of the Day
Loading...
Searching...
No Matches
Teuchos_Serializer.hpp
1// @HEADER
2// *****************************************************************************
3// Teuchos: Common Tools Package
4//
5// Copyright 2004 NTESS and the Teuchos contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef TEUCHOS_SERIALIZER_HPP
11#define TEUCHOS_SERIALIZER_HPP
12
13#include "Teuchos_RCP.hpp"
14
15namespace Teuchos {
16
24template<typename Ordinal, typename T>
26public:
27
29 virtual ~Serializer() {}
30
34 virtual Ordinal getBufferSize(const Ordinal count) const = 0;
35
54 virtual void serialize(
55 const Ordinal count
56 ,const T * const objs[]
57 ,const Ordinal bytes
58 ,char charBuffer[]
59 ) const = 0;
60
61 // const ArrayView<const Ptr<const T> >& objs
62 // std::ostream& oStream
63
66 virtual RCP<T> createObj() const = 0;
67
86 virtual void deserialize(
87 const Ordinal bytes
88 ,const char charBuffer[]
89 ,const Ordinal count
90 ,T * const objs[]
91 ) const = 0;
92
93 // const ArrayView<const Ptr<T> >& objs
94 // std::istream& iStream
95
96};
97
98} // namespace Teuchos
99
100#endif // TEUCHOS_SERIALIZER_HPP
Reference-counted pointer class and non-member templated function implementations.
Smart reference counting pointer class for automatic garbage collection.
Strategy interface for the indirect serializing and deserializing objects of a given type handled usi...
virtual void serialize(const Ordinal count, const T *const objs[], const Ordinal bytes, char charBuffer[]) const =0
Serialize an object to a char[] buffer.
virtual Ordinal getBufferSize(const Ordinal count) const =0
Return an estimate for the maximum storage for count objects to be serialized.
virtual void deserialize(const Ordinal bytes, const char charBuffer[], const Ordinal count, T *const objs[]) const =0
Deserialize an object from a char[] buffer.
virtual RCP< T > createObj() const =0
Create an object of type T to be serialized into.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...