22 #ifndef _BLAZE_UTIL_SERIALIZATION_ARCHIVE_H_
23 #define _BLAZE_UTIL_SERIALIZATION_ARCHIVE_H_
127 template<
typename Stream >
136 template<
typename A1 >
137 explicit inline Archive(
const A1& a1 );
139 template<
typename A1,
typename A2 >
140 explicit inline Archive(
const A1& a1,
const A2& a2 );
142 template<
typename A1,
typename A2,
typename A3 >
143 explicit inline Archive(
const A1& a1,
const A2& a2,
const A3& a3 );
145 template<
typename A1,
typename A2,
typename A3,
typename A4 >
146 explicit inline Archive(
const A1& a1,
const A2& a2,
const A3& a3,
const A4& a4 );
148 template<
typename A1,
typename A2,
typename A3,
typename A4,
typename A5 >
149 explicit inline Archive(
const A1& a1,
const A2& a2,
const A3& a3,
const A4& a4,
const A5& a5 );
162 inline operator bool()
const;
170 template<
typename T >
172 operator<<(
const T& value );
174 template<
typename T >
176 operator<<(
const T& value );
178 template<
typename T >
180 operator>>( T& value );
182 template<
typename T >
184 operator>>( T& value );
186 template<
typename Type >
188 write(
const Type* array,
size_t count );
190 template<
typename Type >
192 read ( Type* array,
size_t count );
199 inline bool good()
const;
200 inline bool eof ()
const;
201 inline bool fail()
const;
202 inline bool bad ()
const;
204 inline std::ios_base::iostate
rdstate ()
const;
205 inline void setstate( std::ios_base::iostate state );
206 inline void clear ( std::ios_base::iostate state = std::ios_base::goodbit );
240 template<
typename Stream >
242 : ptr_ ( new Stream() )
243 , stream_( *ptr_.get() )
256 template<
typename Stream >
257 template<
typename A1 >
259 : ptr_ ( new Stream( a1 ) )
260 , stream_( *ptr_.get() )
274 template<
typename Stream >
275 template<
typename A1
278 : ptr_ ( new Stream( a1, a2 ) )
279 , stream_( *ptr_.get() )
294 template<
typename Stream >
295 template<
typename A1
299 : ptr_ ( new Stream( a1, a2, a3 ) )
300 , stream_( *ptr_.get() )
316 template<
typename Stream >
317 template<
typename A1
322 : ptr_ ( new Stream( a1, a2, a3, a4 ) )
323 , stream_( *ptr_.get() )
340 template<
typename Stream >
341 template<
typename A1
347 : ptr_ ( new Stream( a1, a2, a3, a4, a5 ) )
348 , stream_( *ptr_.get() )
361 template<
typename Stream >
386 template<
typename Stream >
389 return !stream_.
fail();
403 template<
typename Stream >
406 return stream_.fail();
425 template<
typename Stream >
426 template<
typename T >
430 typedef typename Stream::char_type CharType;
431 stream_.write( reinterpret_cast<const CharType*>( &value ),
sizeof( T ) );
443 template<
typename Stream >
444 template<
typename T >
460 template<
typename Stream >
461 template<
typename T >
465 typedef typename Stream::char_type CharType;
466 stream_.read( reinterpret_cast<CharType*>( &value ),
sizeof( T ) );
478 template<
typename Stream >
479 template<
typename T >
498 template<
typename Stream >
499 template<
typename Type >
503 typedef typename Stream::char_type CharType;
504 stream_.write( reinterpret_cast<const CharType*>( array ), count*
sizeof(Type) );
521 template<
typename Stream >
522 template<
typename Type >
526 typedef typename Stream::char_type CharType;
527 stream_.read( reinterpret_cast<CharType*>( array ), count*
sizeof(Type) );
546 template<
typename Stream >
549 return stream_.good();
559 template<
typename Stream >
562 return stream_.eof();
572 template<
typename Stream >
575 return stream_.fail();
585 template<
typename Stream >
588 return stream_.bad();
598 template<
typename Stream >
601 return stream_.rdstate();
612 template<
typename Stream >
615 stream_.setstate( state );
626 template<
typename Stream >
629 return stream_.clear( state );