Click here to Skip to main content
15,895,799 members
Articles / Programming Languages / C++

Persistant Hash Table: Part 2

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
28 Oct 2011CPOL3 min read 16.8K   591   11  
This is a continuation article for a key value store.
#pragma once
#include<Windows.h>
#include<string>
using namespace std;
class CSharedMemory
{
	HANDLE m_fh;
	HANDLE m_hfilemap;
	PBYTE m_pb;
	DWORD m_filesize;
public:
	CSharedMemory():m_fh(0),m_hfilemap(0),m_pb(0),m_filesize(0)
	{
	}
	int createsm(wstring &path,PBYTE *pb);
	int opensm(wstring &path,PBYTE *pb);
	int flush();
	//PBYTE getmemory();
	~CSharedMemory()
	{
		CloseHandle(m_fh);
		CloseHandle(m_hfilemap);
		UnmapViewOfFile(m_pb);
	}
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) EMC
India India
I have worked in ESM, Storage and Embedded domains. Mainly taken part in design, coding and maintaining in c/c++ on windows.
As a hobby tinkering with embedded/electronic devices (new found interestSmile | :) )...

Comments and Discussions