35#ifndef _BLAZE_UTIL_SERIALIZATION_ARCHIVE_H_
36#define _BLAZE_UTIL_SERIALIZATION_ARCHIVE_H_
138template<
typename Stream >
145 template<
typename... Args >
146 explicit inline Archive( Args&&... args );
173 inline operator bool()
const;
181 template<
typename T >
184 template<
typename T >
187 template<
typename T >
190 template<
typename T >
193 template<
typename Type >
196 template<
typename Type >
204 inline typename Stream::int_type
peek()
const;
206 inline bool good()
const;
207 inline bool eof ()
const;
208 inline bool fail()
const;
209 inline bool bad ()
const;
211 inline std::ios_base::iostate
rdstate ()
const;
212 inline void setstate( std::ios_base::iostate state );
213 inline void clear ( std::ios_base::iostate state = std::ios_base::goodbit );
248template<
typename Stream >
249template<
typename... Args >
251 : ptr_ ( new Stream( std::forward<Args>( args )... ) )
252 , stream_( *ptr_.
get() )
265template<
typename Stream >
290template<
typename Stream >
293 return !stream_.
fail();
307template<
typename Stream >
310 return stream_.fail();
329template<
typename Stream >
330template<
typename T >
333 using CharType =
typename Stream::char_type;
334 stream_.write(
reinterpret_cast<const CharType*
>( &value ),
sizeof( T ) );
346template<
typename Stream >
347template<
typename T >
348DisableIf_t< IsNumeric_v<T>, Archive<Stream>& > Archive<Stream>::operator<<(
const T& value )
350 serialize( *
this, value );
362template<
typename Stream >
363template<
typename T >
366 using CharType =
typename Stream::char_type;
367 stream_.read(
reinterpret_cast<CharType*
>( &value ),
sizeof( T ) );
379template<
typename Stream >
380template<
typename T >
398template<
typename Stream >
399template<
typename Type >
403 using CharType =
typename Stream::char_type;
404 stream_.write(
reinterpret_cast<const CharType*
>( array ), count*
sizeof(Type) );
421template<
typename Stream >
422template<
typename Type >
426 using CharType =
typename Stream::char_type;
427 stream_.read(
reinterpret_cast<CharType*
>( array ), count*
sizeof(Type) );
446template<
typename Stream >
449 return stream_.peek();
459template<
typename Stream >
462 return stream_.good();
472template<
typename Stream >
475 return stream_.eof();
485template<
typename Stream >
488 return stream_.fail();
498template<
typename Stream >
501 return stream_.bad();
511template<
typename Stream >
514 return stream_.rdstate();
525template<
typename Stream >
528 stream_.setstate( state );
539template<
typename Stream >
542 return stream_.clear( state );
Header file for the EnableIf class template.
Header file for the IsNumeric type trait.
void deserialize(Archive &archive, Matrix< MT, SO > &mat)
Deserializes a matrix from the given archive.
Definition: MatrixSerializer.h:1278
Binary archive for the portable serialization of data.
Definition: Archive.h:140
bool operator!() const
Returns the negated state of the archive.
Definition: Archive.h:308
bool good() const
Checks if no error has occurred, i.e. I/O operations are available.
Definition: Archive.h:460
void setstate(std::ios_base::iostate state)
Sets the state flags to a specific value.
Definition: Archive.h:526
void clear(std::ios_base::iostate state=std::ios_base::goodbit)
Clears error and eof flags.
Definition: Archive.h:540
Archive(Args &&... args)
Creating an archive with an internal stream resource.
Definition: Archive.h:250
std::unique_ptr< Stream > ptr_
The dynamically allocated stream resource.
Definition: Archive.h:221
bool fail() const
Checks if a recoverable error has occurred.
Definition: Archive.h:486
bool bad() const
Checks if a non-recoverable error has occurred.
Definition: Archive.h:499
Stream::int_type peek() const
Reads the next character from the input stream without extracting it.
Definition: Archive.h:447
std::ios_base::iostate rdstate() const
Returns the current state flags settings.
Definition: Archive.h:512
bool eof() const
Checks if end-of-file (EOF) has been reached.
Definition: Archive.h:473
Stream & stream_
Reference to the bound stream.
Definition: Archive.h:225
decltype(auto) operator<<(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Left-shift operator for the elementwise left-shift of a dense matrix.
Definition: DMatDMatMapExpr.h:1570
decltype(auto) operator>>(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Right-shift operator for the elementwise right-shift of a dense matrix.
Definition: DMatDMatMapExpr.h:1604
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > stream(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned, non-temporal store of a vector of 1-byte integral values.
Definition: Stream.h:74
constexpr Type & get(StaticVector< Type, N, TF, AF, PF, Tag > &v) noexcept
Tuple-like index-based access the contents of a static vector.
Definition: StaticVector.h:3052
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:138
typename EnableIf<!Condition, T >::Type DisableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:175
Header file for basic type definitions.