/***************************************************************************

    supportware
    Copyright (C) 2001-2008 by c.holzheuer
    c.holzheuer@sourceworx.org

    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.

***************************************************************************/


#ifndef DDMMAP_H
#define DDMMAP_H

#include <ddiobuffer.h>
#include <sys/mman.h>

/// ddiommap is a simple wrapper class for the ::mmap syscall.


class ddiommap : public ddiobuffer
{

public:

	ddiommap();
	ddiommap( const ddstring& filename, int prot= PROT_READ );	//|PROT_WRITE
	virtual ~ddiommap();

	int  mmap( const ddstring& filename, int prot = PROT_READ );//|PROT_WRITE
	void unmap();

	void dump() const;

private:

	ddiommap( const ddiommap& src );
	ddiommap& operator=( const ddiommap& src );

};

#endif
