A helper class to insert containers from single elements. More...
#include <binary_streams.hpp>

Public Member Functions | |
| container_writer (size_t size, bostream &bos) | |
| Default constructor. | |
| container_writer & | operator<< (T element) |
| Push an element. | |
| ~container_writer () | |
| Default destructor. | |
Private Attributes | |
| size_t | _elements_left |
| The amount of elements you have yet to insert. | |
| bostream & | _bos |
| A reference to the output stream. | |
A helper class to insert containers from single elements.
Use this when you know that the data will later be read into a vector or some other container but you don't have such a container for insertion, you want to create it on the go.
| T | : The type of the elements in the container. |
Definition at line 289 of file binary_streams.hpp.
| ana::serializer::container_writer< T >::container_writer | ( | size_t | size, | |
| bostream & | bos | |||
| ) | [inline] |
Default constructor.
| size | : The amount of elements you will write. | |
| bos | : A reference to the output stream where you will create the container. |
Definition at line 300 of file binary_streams.hpp.
References ana::serializer::container_writer< T >::_bos.
| ana::serializer::container_writer< T >::~container_writer | ( | ) | [inline] |
Default destructor.
Definition at line 326 of file binary_streams.hpp.
References ana::serializer::container_writer< T >::_elements_left.
| container_writer& ana::serializer::container_writer< T >::operator<< | ( | T | element | ) | [inline] |
Push an element.
Definition at line 310 of file binary_streams.hpp.
References ana::serializer::container_writer< T >::_bos, and ana::serializer::container_writer< T >::_elements_left.
bostream& ana::serializer::container_writer< T >::_bos [private] |
A reference to the output stream.
Definition at line 337 of file binary_streams.hpp.
Referenced by ana::serializer::container_writer< T >::container_writer(), and ana::serializer::container_writer< T >::operator<<().
size_t ana::serializer::container_writer< T >::_elements_left [private] |
The amount of elements you have yet to insert.
Definition at line 334 of file binary_streams.hpp.
Referenced by ana::serializer::container_writer< T >::operator<<(), and ana::serializer::container_writer< T >::~container_writer().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:19:19 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |