--- /dev/null
+//
+// C++ Interface: nullable
+//
+// Description:
+//
+//
+// Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2009
+//
+// Copyright: See README/COPYING files that come with this distribution
+//
+//
+
+
+#ifndef WOLF_NULLABLE_H
+#define WOLF_NULLABLE_H
+
+template<class T>class Nullable
+{
+ public:
+ Nullable(){isnull=true;}
+ Nullable(const T&t){isnull=false;elem=t;}
+ Nullable(const Nullable<T>&t){isnull=t.isnull;elem=t.elem;}
+
+ Nullable<T>& operator=(const T&t){isnull=false;elem=t;}
+ Nullable<T>& operator=(const Nullable<T>&t){isnull=t.isnull;elem=t.elem;}
+
+ bool isNull()const{return isnull;}
+
+ operator T()const{if(isnull)return T();else return elem;}
+
+ T& value(){return elem;}
+ T value()const{if(isnull)return T();else return elem;}
+ private:
+ bool isnull;
+ T elem;
+};
+
+typedef Nullable<int> Int;
+typedef Nullable<qint32> Int32;
+typedef Nullable<qint64> Int64;
+typedef Nullable<quint32> UInt32;
+typedef Nullable<quint64> UInt64;
+typedef Nullable<QString> NString;
+
+#endif