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;
47 virtual void allocateBuffer(Int64 nb_real, Int64 nb_int16, Int64 nb_int32,
48 Int64 nb_int64, Int64 nb_byte, Int64 nb_int8, Int64 nb_float16,
49 Int64 nb_bfloat16, Int64 nb_float32) = 0;
50 virtual void copy(Impl* rhs) = 0;
51 virtual Span<Byte> globalBuffer() = 0;
52 virtual Span<const Byte> globalBuffer()
const = 0;
55 virtual void preallocate(Int64 size) = 0;
56 virtual void releaseBuffer() = 0;
57 virtual void setFromSizes() = 0;
58 virtual Int64 totalSize()
const = 0;
59 virtual void printSizes(std::ostream& o)
const = 0;
63 ARCCORE_DEPRECATED_REASON(
"Y2023: use overload with float16/float32")
64 virtual
void allocateBuffer(Int64 nb_real, Int64 nb_int16, Int64 nb_int32,
65 Int64 nb_int64, Int64 nb_byte) = 0;
71class ARCCORE_SERIALIZE_EXPORT BasicSerializer::Impl2
80 Span<const Real> realBytes()
const {
return m_real.m_buffer; }
81 Span<const Int64> int64Bytes()
const {
return m_int64.m_buffer; }
82 Span<const Int32> int32Bytes()
const {
return m_int32.m_buffer; }
83 Span<const Int16> int16Bytes()
const {
return m_int16.m_buffer; }
84 Span<const Byte> byteBytes()
const {
return m_byte.m_buffer; }
85 Span<const Int8> int8Bytes()
const {
return m_int8.m_buffer; }
86 Span<const Float16> float16Bytes()
const {
return m_float16.m_buffer; }
87 Span<const BFloat16> bfloat16Bytes()
const {
return m_bfloat16.m_buffer; }
88 Span<const Float32> float32Bytes()
const {
return m_float32.m_buffer; }
92 void reserve(eDataType dt, Int64 n, Int64 nb_put);
93 void putType(eBasicDataType t);
94 void getAndCheckType(eBasicDataType expected_type);
105 ARCCORE_DEPRECATED_REASON(
"Y2023: use overload with float16/float32")
111 void setSerializeTypeInfo(
bool v) { m_is_serialize_typeinfo = v; }
112 bool isSerializeTypeInfo()
const {
return m_is_serialize_typeinfo; }
117 eReadMode m_read_mode;
118 BasicSerializer::Impl* m_p;
119 bool m_is_serialize_typeinfo =
false;
120 BasicSerializerDataT<Real> m_real;
121 BasicSerializerDataT<Int64> m_int64;
122 BasicSerializerDataT<Int32> m_int32;
123 BasicSerializerDataT<Int16> m_int16;
124 BasicSerializerDataT<Byte> m_byte;
125 BasicSerializerDataT<Int8> m_int8;
126 BasicSerializerDataT<Float16> m_float16;
127 BasicSerializerDataT<BFloat16> m_bfloat16;
128 BasicSerializerDataT<Float32> m_float32;
Fichier contenant les définitions des types de données basiques gérés par Arccore.
void allocateBuffer()
Alloue la mémoire du sérialiseur.
void setMode(eMode new_mode)
Positionne le fonctionnement actuel.
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.