35 #ifndef _BLAZE_UTIL_SERIALIZATION_ARCHIVE_H_
36 #define _BLAZE_UTIL_SERIALIZATION_ARCHIVE_H_
140 template<
typename Stream >
147 template<
typename... Args >
148 explicit inline Archive( Args&&... args );
161 inline operator bool()
const;
169 template<
typename T >
172 template<
typename T >
175 template<
typename T >
178 template<
typename T >
181 template<
typename Type >
184 template<
typename Type >
192 inline typename Stream::int_type
peek()
const;
194 inline bool good()
const;
195 inline bool eof ()
const;
196 inline bool fail()
const;
197 inline bool bad ()
const;
199 inline std::ios_base::iostate
rdstate ()
const;
200 inline void setstate( std::ios_base::iostate state );
201 inline void clear ( std::ios_base::iostate state = std::ios_base::goodbit );
237 template<
typename Stream >
238 template<
typename... Args >
240 : ptr_ ( new Stream(
std::forward<Args>( args )... ) )
241 , stream_( *ptr_.get() )
254 template<
typename Stream >
279 template<
typename Stream >
282 return !stream_.
fail();
296 template<
typename Stream >
299 return stream_.fail();
318 template<
typename Stream >
319 template<
typename T >
322 typedef typename Stream::char_type CharType;
323 stream_.write( reinterpret_cast<const CharType*>( &value ),
sizeof( T ) );
335 template<
typename Stream >
336 template<
typename T >
351 template<
typename Stream >
352 template<
typename T >
355 typedef typename Stream::char_type CharType;
356 stream_.read( reinterpret_cast<CharType*>( &value ),
sizeof( T ) );
368 template<
typename Stream >
369 template<
typename T >
387 template<
typename Stream >
388 template<
typename Type >
392 typedef typename Stream::char_type CharType;
393 stream_.write( reinterpret_cast<const CharType*>( array ), count*
sizeof(Type) );
410 template<
typename Stream >
411 template<
typename Type >
415 typedef typename Stream::char_type CharType;
416 stream_.read( reinterpret_cast<CharType*>( array ), count*
sizeof(Type) );
435 template<
typename Stream >
438 return stream_.peek();
448 template<
typename Stream >
451 return stream_.good();
461 template<
typename Stream >
464 return stream_.eof();
474 template<
typename Stream >
477 return stream_.fail();
487 template<
typename Stream >
490 return stream_.bad();
500 template<
typename Stream >
503 return stream_.rdstate();
514 template<
typename Stream >
517 stream_.setstate( state );
528 template<
typename Stream >
531 return stream_.clear( state );
Archive(Args &&...args)
Creating an archive with an internal stream resource.
Definition: Archive.h:239
Binary archive for the portable serialization of data.The Archive class implements the functionality ...
Definition: Archive.h:141
Header file for basic type definitions.
Base class for non-copyable class instances.
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:223
Stream & stream_
Reference to the bound stream.
Definition: Archive.h:214
void clear(std::ios_base::iostate state=std::ios_base::goodbit)
Clears error and eof flags.
Definition: Archive.h:529
std::ios_base::iostate rdstate() const
Returns the current state flags settings.
Definition: Archive.h:501
bool operator!() const
Returns the negated state of the archive.
Definition: Archive.h:297
Header file for the DisableIf class template.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
void serialize(Archive &archive, const Matrix< MT, SO > &mat)
Serializes the given matrix and writes it to the archive.
Definition: MatrixSerializer.h:1268
bool good() const
Checks if no error has occurred, i.e. I/O operations are available.
Definition: Archive.h:449
Base class for non-copyable class instances.The NonCopyable class is intended to work as a base class...
Definition: NonCopyable.h:63
bool eof() const
Checks if end-of-file (EOF) has been reached.
Definition: Archive.h:462
Header file for the EnableIf class template.
std::unique_ptr< Stream > ptr_
The dynamically allocated stream resource.
Definition: Archive.h:210
Header file for the IsNumeric type trait.
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< 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:75
Stream::int_type peek() const
Reads the next character from the input stream without extracting it.
Definition: Archive.h:436
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
void deserialize(Archive &archive, Matrix< MT, SO > &mat)
Deserializes a matrix from the given archive.
Definition: MatrixSerializer.h:1290
bool bad() const
Checks if a non-recoverable error has occurred.
Definition: Archive.h:488
void setstate(std::ios_base::iostate state)
Sets the state flags to a specific value.
Definition: Archive.h:515
bool fail() const
Checks if a recoverable error has occurred.
Definition: Archive.h:475