12#ifndef ARCCORE_SERIALIZE_BASICSERIALIZERINTERNAL_H
13#define ARCCORE_SERIALIZE_BASICSERIALIZERINTERNAL_H
17#include "arccore/serialize/BasicSerializer.h"
29class ARCCORE_SERIALIZE_EXPORT BasicSerializer::Impl
37 virtual Span<Real> getRealBuffer() = 0;
38 virtual Span<Int16> getInt16Buffer() = 0;
39 virtual Span<Int32> getInt32Buffer() = 0;
40 virtual Span<Int64> getInt64Buffer() = 0;
41 virtual Span<Byte> getByteBuffer() = 0;
42 virtual Span<Int8> getInt8Buffer() = 0;
43 virtual Span<Float16> getFloat16Buffer() = 0;
44 virtual Span<BFloat16> getBFloat16Buffer() = 0;
45 virtual Span<Float32> getFloat32Buffer() = 0;
46 virtual Span<Float128> getFloat128Buffer() = 0;
47 virtual Span<Int128> getInt128Buffer() = 0;
49 virtual void allocateBuffer(
Int64 nb_real,
Int64 nb_int16,
Int64 nb_int32,
52 virtual void copy(Impl* rhs) = 0;
53 virtual Span<Byte> globalBuffer() = 0;
54 virtual Span<const Byte> globalBuffer()
const = 0;
57 virtual void preallocate(
Int64 size) = 0;
58 virtual void releaseBuffer() = 0;
59 virtual void setFromSizes() = 0;
60 virtual Int64 totalSize()
const = 0;
61 virtual void printSizes(std::ostream& o)
const = 0;
65 ARCCORE_DEPRECATED_REASON(
"Y2023: use overload with float16/float32")
66 virtual
void allocateBuffer(
Int64 nb_real,
Int64 nb_int16,
Int64 nb_int32,
73class ARCCORE_SERIALIZE_EXPORT BasicSerializer::Impl2
82 Span<const Real> realBytes()
const {
return m_real.m_buffer; }
83 Span<const Int64> int64Bytes()
const {
return m_int64.m_buffer; }
84 Span<const Int32> int32Bytes()
const {
return m_int32.m_buffer; }
85 Span<const Int16> int16Bytes()
const {
return m_int16.m_buffer; }
86 Span<const Byte> byteBytes()
const {
return m_byte.m_buffer; }
87 Span<const Int8> int8Bytes()
const {
return m_int8.m_buffer; }
88 Span<const Float16> float16Bytes()
const {
return m_float16.m_buffer; }
89 Span<const BFloat16> bfloat16Bytes()
const {
return m_bfloat16.m_buffer; }
90 Span<const Float32> float32Bytes()
const {
return m_float32.m_buffer; }
91 Span<const Float128> float128Bytes()
const {
return m_float128.m_buffer; }
92 Span<const Int128> int128Bytes()
const {
return m_int128.m_buffer; }
96 ARCCORE_DEPRECATED_REASON(
"Y2024: Use reserve(eBasicDataType) instead")
97 void reserve(eDataType dt,
Int64 n,
Int64 nb_put);
98 void reserve(eBasicDataType dt,
Int64 n,
Int64 nb_put);
99 void putType(eBasicDataType t);
100 void getAndCheckType(eBasicDataType expected_type);
101 void allocateBuffer();
111 ARCCORE_DEPRECATED_REASON("Y2023: use overload with float16/float32")
117 void setSerializeTypeInfo(
bool v) { m_is_serialize_typeinfo = v; }
118 bool isSerializeTypeInfo()
const {
return m_is_serialize_typeinfo; }
123 eReadMode m_read_mode;
124 BasicSerializer::Impl* m_p;
125 bool m_is_serialize_typeinfo =
false;
126 BasicSerializerDataT<Real> m_real;
127 BasicSerializerDataT<Int64> m_int64;
128 BasicSerializerDataT<Int32> m_int32;
129 BasicSerializerDataT<Int16> m_int16;
130 BasicSerializerDataT<Byte> m_byte;
131 BasicSerializerDataT<Int8> m_int8;
132 BasicSerializerDataT<Float16> m_float16;
133 BasicSerializerDataT<BFloat16> m_bfloat16;
134 BasicSerializerDataT<Float32> m_float32;
135 BasicSerializerDataT<Float128> m_float128;
136 BasicSerializerDataT<Int128> m_int128;
Fichier contenant les définitions des types de données basiques gérés par Arccore.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Implémentation basique de 'ISerializer'.
eMode
Mode de fonctionnement du sérialiseur.
char * copy(char *to, const char *from)
Copie from dans to.
ConstArrayView< Byte > ByteConstArrayView
Equivalent C d'un tableau à une dimension de caractères.
ConstArrayView< Int64 > Int64ConstArrayView
Equivalent C d'un tableau à une dimension d'entiers 64 bits.
Espace de nom de Arccore.
std::int64_t Int64
Type entier signé sur 64 bits.