/*
Copyright (C) 2006 Evan Teran
                   eteran@alum.rit.edu

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

#ifndef BYTESTREAMREGION_20060705_H_
#define BYTESTREAMREGION_20060705_H_

#include "ByteStream.h"
#include "MemoryRegions.h"

class ByteStreamRegion : public ByteStream {
public:
	ByteStreamRegion();
	ByteStreamRegion(const MemoryRegions::Region &r);
	
public:	// container information
	virtual size_type size() const;
	virtual size_type max_size() const;
	virtual bool empty() const;
	
public:	// element access
	virtual value_type read(size_type i) const;
	virtual void write(size_type i, const value_type &v);
	
public:
	virtual void clear();
	
public:
	void setRegion(const MemoryRegions::Region &r);
	
private:
	MemoryRegions::Region m_Region;
};

#endif

