/***************************************************************************
*   Copyright (C) 2004 by Denis A. Birukov aka Messenger of death         *
*   riper@fromru.com                                                      *
*                                                                         *
*   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.,                                       *
*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
***************************************************************************/
#ifndef ME_C_STORAGEENTRY_H
#define ME_C_STORAGEENTRY_H
#include <me_defines.h>
#include <string>
namespace ME_n_Storage
{
	/**
	This class is a container for various data. 
	The one of possible uses is a config storage.
	It can contain int, double or string values.

	@author Denis A. Birukov aka Messenger of death 
	*/
	class ME_c_Storage_Entry
	{
			union
			{
				Uint32 _ui32_value_;
				Sint32 _si32_value_;
				Uint16 _ui16_value_;
				Sint16 _si16_value_;
				Uint8 _ui8_value_;
				Sint8 _si8_value_;
				double _d_value_;
			};
			std::string _s_value_;
			Sint16 _type_;
		public:

			ME_c_Storage_Entry( Sint16 type, void* data );
			/**Return a type of data in storage*/
			DECLSPEC Sint16 _get_type( void );
			/** Return a value. It should be converted to the right type statically. It return a pointer to the value, so it can be changed. Be careful when use it.*/
			DECLSPEC void* _get_value( void );
			~ME_c_Storage_Entry ( );
	};
}

#endif
