DoorKeeper/include/components/tilestream.hpp
2014-12-22 16:56:17 +01:00

44 lines
1.2 KiB
C++

#ifndef id9B1C02049E474F6997D367932C4C2D21
#define id9B1C02049E474F6997D367932C4C2D21
#include "primitivetypes.hpp"
#include <iostream>
#include <vector>
#include <algorithm>
#include <memory>
#include <iterator>
//This code might need to be removed, but for now it's handy to read a simple
//ascii file into a vector without worrying too much about details.
//TODO: remove along with the code in the constructor
#include "implem/asciimap_parser.hpp"
#include <iomanip>
#include <stdexcept>
namespace dk {
template <typename T, size_t D>
class TileStreamer {
public:
typedef Vector<CoordinateScalarType, D> coords;
typedef std::unique_ptr<std::istream> StreamPtr;
explicit TileStreamer ( StreamPtr&& parStream );
TileStreamer ( const TileStreamer& ) = delete;
TileStreamer ( TileStreamer&& ) = default;
~TileStreamer ( void ) noexcept = default;
TileStreamer& operator= ( const TileStreamer& ) = delete;
void copy ( std::vector<T>& parDest, const coords& parFrom, const coords& parTo );
const coords& tilesCount ( void ) const { return m_count; }
private:
StreamPtr m_stream;
coords m_count;
std::vector<T> m_wholedata;
};
} //namespace dk
#include "implem/tilestreamer.inl"
#endif