#ifndef TOOLBOX_TOOLS_H
#define TOOLBOX_TOOLS_H

// hide VDR's new cHash class...
#define cHash cHashMPC

#define LOGi cout << programName << ": "
#define LOGe cerr << programName << ": "

#ifdef NO_VDR_TOOLS_H
#	define KILOBYTE(x) ((x)*1024)
#	define MEGABYTE(x) (KILOBYTE(x)*1024)
#endif

#if !defined(NULL)
#	define NULL 0L
#endif

extern const char *programName;

typedef unsigned int  uint;
typedef unsigned long ulong;

// Special constructor for createElements
void *operator new(uint, void*) throw ();

#ifdef DEBUG
	void *operator new(uint);
#	define ASSERT(x) if ((x)) cerr << "Warning: ASSERT failed at " << __FILE__ << ":" << __LINE__ << " ["#x"]" << endl
#	define CHECK_PTR(x) if (!(x)) cerr << "Warning: Pointer is NULL at " << __FILE__ << ":" << __LINE__ << endl;
#	define CHECK_NEXT_ALLOC() _checkNextAlloc()
#else
#	define ASSERT(x)
#	define CHECK_PTR(x)
#	define CHECK_NEXT_ALLOC()
#endif

// Forward declarations for all classes
class cObject;
class cSource;
class cFile;
class cSocket;

class cType;
template<class T> class cBasic;
class cShared;
class cString;
class cSockAddr;
class cSockAddr_in;

class cCollection;
template<class T> class cTBList;
template<class K,class D> class cTMap;
template<class K,class D> class cSMap;
template<class K,class D> class cHash;

class cException;
class cGenericException;
class cMemoryException;
class cSourceException;
class cFileException;
class cSocketException;

#endif // TOOLBOX_TOOLS_H
