35 #ifndef _BLAZE_UTIL_SERIALIZATION_ARCHIVE_H_
36 #define _BLAZE_UTIL_SERIALIZATION_ARCHIVE_H_
140 template<
typename Stream >
149 template<
typename A1 >
150 explicit inline Archive(
const A1& a1 );
152 template<
typename A1,
typename A2 >
153 explicit inline Archive(
const A1& a1,
const A2& a2 );
155 template<
typename A1,
typename A2,
typename A3 >
156 explicit inline Archive(
const A1& a1,
const A2& a2,
const A3& a3 );
158 template<
typename A1,
typename A2,
typename A3,
typename A4 >
159 explicit inline Archive(
const A1& a1,
const A2& a2,
const A3& a3,
const A4& a4 );
161 template<
typename A1,
typename A2,
typename A3,
typename A4,
typename A5 >
162 explicit inline Archive(
const A1& a1,
const A2& a2,
const A3& a3,
const A4& a4,
const A5& a5 );
175 inline operator bool()
const;
183 template<
typename T >
185 operator<<(
const T& value );
187 template<
typename T >
189 operator<<(
const T& value );
191 template<
typename T >
193 operator>>( T& value );
195 template<
typename T >
197 operator>>( T& value );
199 template<
typename Type >
201 write(
const Type* array,
size_t count );
203 template<
typename Type >
205 read ( Type* array,
size_t count );
212 inline bool good()
const;
213 inline bool eof ()
const;
214 inline bool fail()
const;
215 inline bool bad ()
const;
217 inline std::ios_base::iostate
rdstate ()
const;
218 inline void setstate( std::ios_base::iostate state );
219 inline void clear ( std::ios_base::iostate state = std::ios_base::goodbit );
253 template<
typename Stream >
255 : ptr_ ( new Stream() )
256 , stream_( *ptr_.get() )
269 template<
typename Stream >
270 template<
typename A1 >
272 : ptr_ ( new Stream( a1 ) )
273 , stream_( *ptr_.get() )
287 template<
typename Stream >
288 template<
typename A1
291 : ptr_ ( new Stream( a1, a2 ) )
292 , stream_( *ptr_.get() )
307 template<
typename Stream >
308 template<
typename A1
312 : ptr_ ( new Stream( a1, a2, a3 ) )
313 , stream_( *ptr_.get() )
329 template<
typename Stream >
330 template<
typename A1
335 : ptr_ ( new Stream( a1, a2, a3, a4 ) )
336 , stream_( *ptr_.get() )
353 template<
typename Stream >
354 template<
typename A1
360 : ptr_ ( new Stream( a1, a2, a3, a4, a5 ) )
361 , stream_( *ptr_.get() )
374 template<
typename Stream >
399 template<
typename Stream >
402 return !stream_.
fail();
416 template<
typename Stream >
419 return stream_.fail();
438 template<
typename Stream >
439 template<
typename T >
443 typedef typename Stream::char_type CharType;
444 stream_.write( reinterpret_cast<const CharType*>( &value ),
sizeof( T ) );
456 template<
typename Stream >
457 template<
typename T >
473 template<
typename Stream >
474 template<
typename T >
478 typedef typename Stream::char_type CharType;
479 stream_.read( reinterpret_cast<CharType*>( &value ),
sizeof( T ) );
491 template<
typename Stream >
492 template<
typename T >
511 template<
typename Stream >
512 template<
typename Type >
516 typedef typename Stream::char_type CharType;
517 stream_.write( reinterpret_cast<const CharType*>( array ), count*
sizeof(Type) );
534 template<
typename Stream >
535 template<
typename Type >
539 typedef typename Stream::char_type CharType;
540 stream_.read( reinterpret_cast<CharType*>( array ), count*
sizeof(Type) );
559 template<
typename Stream >
562 return stream_.good();
572 template<
typename Stream >
575 return stream_.eof();
585 template<
typename Stream >
588 return stream_.fail();
598 template<
typename Stream >
601 return stream_.bad();
611 template<
typename Stream >
614 return stream_.rdstate();
625 template<
typename Stream >
628 stream_.setstate( state );
639 template<
typename Stream >
642 return stream_.clear( state );
Binary archive for the portable serialization of data.The Archive class implements the functionality ...
Definition: Archive.h:141
Base class for non-copyable class instances.
Stream & stream_
Reference to the bound stream.
Definition: Archive.h:232
void clear(std::ios_base::iostate state=std::ios_base::goodbit)
Clears error and eof flags.
Definition: Archive.h:640
Header file for the UniquePtr smart pointer class.
std::ios_base::iostate rdstate() const
Returns the current state flags settings.
Definition: Archive.h:612
void stream(float *address, const sse_float_t &value)
Aligned, non-temporal store of a vector of 'float' values.
Definition: Stream.h:233
bool operator!() const
Returns the negated state of the archive.
Definition: Archive.h:417
Header file for the DisableIf class template.
UniquePtr< Stream > ptr_
The dynamically allocated stream resource.
Definition: Archive.h:228
void serialize(Archive &archive, const Matrix< MT, SO > &mat)
Serializes the given matrix and writes it to the archive.
Definition: MatrixSerializer.h:1248
bool good() const
Checks if no error has occurred, i.e. I/O operations are available.
Definition: Archive.h:560
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:573
Header file for the EnableIf class template.
Header file for the IsNumeric type trait.
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
Substitution Failure Is Not An Error (SFINAE) class.The DisableIf class template is an auxiliary tool...
Definition: DisableIf.h:184
void deserialize(Archive &archive, Matrix< MT, SO > &mat)
Deserializes a matrix from the given archive.
Definition: MatrixSerializer.h:1270
Archive()
Creating an archive with an internal stream resource.
Definition: Archive.h:254
bool bad() const
Checks if a non-recoverable error has occurred.
Definition: Archive.h:599
Header file for basic type definitions.
void setstate(std::ios_base::iostate state)
Sets the state flags to a specific value.
Definition: Archive.h:626
bool fail() const
Checks if a recoverable error has occurred.
Definition: Archive.h:586