// Copyright (C) 2004-2009 Christoph Kubisch & Eike Decker
// This file is part of the "Luxinia Engine".
// For conditions of distribution and use, see copyright notice in luxiniapublicsdk.txt
//
// <Author: Christoph Kubisch>

#ifndef __LUXCORE_CONTMAP_H__
#define __LUXCORE_CONTMAP_H__

#include <luxcore/contvector.h>

#ifdef __cplusplus
extern "C"{
#endif

	//////////////////////////////////////////////////////////////////////////
	// ContMap
	//	a simple map, that uses memcmp to for comparing keys
	//	Based on vector, therefore removal can be quite costly

	typedef struct lxContMap_s{
		lxContVector_t keys;
		lxContVector_t values;
	}lxContMap_t;


	void	lxContMap_init(lxContMap_t* cv, size_t keysize, size_t valsize);
	
	booln	lxContMap_set(lxContMap_t* cv, void *key, void *val);
	booln	lxContMap_get(lxContMap_t* cv, void *key, void **outval);
	booln	lxContMap_remove(lxContMap_t* cv, void *key);

		// frees memory
	void	lxContMap_clear(lxContMap_t *cv);
	
#ifdef __cplusplus
}
#endif


#endif
