#ifndef STREAM_H
#define STREAM_H

namespace Salamander
{

class UniqueId;
class IStreamData;

/*
** A DataStream contains data in a block of memory, formatted for rendering.
*/
class Stream
{
public:
	/*
	** Constructor
	*/
	Stream(const UniqueId& typeId);

	/*
	** Destructor.
	*/
	virtual ~Stream();

	/*
	** Get the Id from the type of content
	*/
	const UniqueId& typeId();

	/*
	** Get the raw data ready for rendering.
	*/
	const IStreamData& get(unsigned int index) const;

	/*
	** Add a new datapoint to the stream.
	*/
	bool add(const IStreamData& streamData);

	/*
	** How many datapoints in the stream?
	*/
	unsigned int size() const;

	/*
	** Set the raw data.
	*/
	bool set(unsigned int index, const IStreamData& streamData);

private:
	/*
	** This UniqueId corresponds to the type of data this stream contains.
	*/
	const UniqueId& typeId_;

	/*
	** Stream holds a bare array of StreamData objects, formatted in such a way
	** so as to require minimal processing when passed to the renderer.
	*/
	std::vector<const IStreamData*> streamDatas_;

};

}

#endif // STREAM_H