35 #ifndef _BLAZE_UTIL_SERIALIZATION_ARCHIVE_H_ 36 #define _BLAZE_UTIL_SERIALIZATION_ARCHIVE_H_ 139 template<
typename Stream >
146 template<
typename... Args >
147 explicit inline Archive( Args&&... args );
174 inline operator bool()
const;
182 template<
typename T >
185 template<
typename T >
188 template<
typename T >
191 template<
typename T >
194 template<
typename Type >
197 template<
typename Type >
205 inline typename Stream::int_type
peek()
const;
207 inline bool good()
const;
208 inline bool eof ()
const;
209 inline bool fail()
const;
210 inline bool bad ()
const;
212 inline std::ios_base::iostate
rdstate ()
const;
213 inline void setstate( std::ios_base::iostate state );
214 inline void clear ( std::ios_base::iostate state = std::ios_base::goodbit );
249 template<
typename Stream >
250 template<
typename... Args >
252 : ptr_ ( new Stream(
std::forward<Args>( args )... ) )
253 , stream_( *ptr_.get() )
266 template<
typename Stream >
291 template<
typename Stream >
294 return !stream_.
fail();
308 template<
typename Stream >
311 return stream_.fail();
330 template<
typename Stream >
331 template<
typename T >
334 using CharType =
typename Stream::char_type;
335 stream_.write( reinterpret_cast<const CharType*>( &value ),
sizeof( T ) );
347 template<
typename Stream >
348 template<
typename T >
363 template<
typename Stream >
364 template<
typename T >
367 using CharType =
typename Stream::char_type;
368 stream_.read( reinterpret_cast<CharType*>( &value ),
sizeof( T ) );
380 template<
typename Stream >
381 template<
typename T >
399 template<
typename Stream >
400 template<
typename Type >
404 using CharType =
typename Stream::char_type;
405 stream_.write( reinterpret_cast<const CharType*>( array ), count*
sizeof(Type) );
422 template<
typename Stream >
423 template<
typename Type >
427 using CharType =
typename Stream::char_type;
428 stream_.read( reinterpret_cast<CharType*>( array ), count*
sizeof(Type) );
447 template<
typename Stream >
450 return stream_.peek();
460 template<
typename Stream >
463 return stream_.good();
473 template<
typename Stream >
476 return stream_.eof();
486 template<
typename Stream >
489 return stream_.fail();
499 template<
typename Stream >
502 return stream_.bad();
512 template<
typename Stream >
515 return stream_.rdstate();
526 template<
typename Stream >
529 stream_.setstate( state );
540 template<
typename Stream >
543 return stream_.clear( state );
Stream::int_type peek() const
Reads the next character from the input stream without extracting it.
Definition: Archive.h:448
Binary archive for the portable serialization of data.The Archive class implements the functionality ...
Definition: Archive.h:140
Header file for basic type definitions.
std::istream & operator>>(std::istream &is, UnsignedValue< T > &uv)
Global input operator for the UnsignedValue wrapper.
Definition: UnsignedValue.h:358
bool good() const
Checks if no error has occurred, i.e. I/O operations are available.
Definition: Archive.h:461
Stream & stream_
Reference to the bound stream.
Definition: Archive.h:226
void clear(std::ios_base::iostate state=std::ios_base::goodbit)
Clears error and eof flags.
Definition: Archive.h:541
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
Header file for the DisableIf class template.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Archive(Args &&... args)
Creating an archive with an internal stream resource.
Definition: Archive.h:251
void serialize(Archive &archive, const Matrix< MT, SO > &mat)
Serializes the given matrix and writes it to the archive.
Definition: MatrixSerializer.h:1257
bool eof() const
Checks if end-of-file (EOF) has been reached.
Definition: Archive.h:474
Header file for the EnableIf class template.
std::ios_base::iostate rdstate() const
Returns the current state flags settings.
Definition: Archive.h:513
std::unique_ptr< Stream > ptr_
The dynamically allocated stream resource.
Definition: Archive.h:222
Header file for the IsNumeric type trait.
std::ostream & operator<<(std::ostream &os, const Matrix< MT, SO > &m)
Global output operator for dense and sparse matrices.
Definition: Matrix.h:789
void deserialize(Archive &archive, Matrix< MT, SO > &mat)
Deserializes a matrix from the given archive.
Definition: MatrixSerializer.h:1279
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
bool fail() const
Checks if a recoverable error has occurred.
Definition: Archive.h:487
void setstate(std::ios_base::iostate state)
Sets the state flags to a specific value.
Definition: Archive.h:527
bool bad() const
Checks if a non-recoverable error has occurred.
Definition: Archive.h:500
typename DisableIf< Condition, T >::Type DisableIf_t
Auxiliary type for the DisableIf class template.The DisableIf_t alias declaration provides a convenie...
Definition: DisableIf.h:138
bool operator!() const
Returns the negated state of the archive.
Definition: Archive.h:309