lib
value.h
00001 /*************************************************************************** 00002 * value.h 00003 * This file is part of the KDE project 00004 * copyright (C)2004-2005 by Sebastian Sauer (mail@dipe.org) 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Library General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Library General Public License for more details. 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this program; see the file COPYING. If not, write to 00016 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 * Boston, MA 02110-1301, USA. 00018 ***************************************************************************/ 00019 00020 #ifndef KROSS_API_VALUE_H 00021 #define KROSS_API_VALUE_H 00022 00023 #include <qstring.h> 00024 #include <qvariant.h> 00025 //#include <kdebug.h> 00026 00027 #include "object.h" 00028 00029 namespace Kross { namespace Api { 00030 00038 template<class T, class V> 00039 class Value : public Object 00040 { 00041 public: 00042 00050 Value(V value, const QString& name) 00051 : Object(name) 00052 , m_value(value) {} 00053 00057 virtual ~Value() {} 00058 00059 //operator V&() const { return m_value; } 00060 00066 V& getValue() { return m_value; } 00067 //operator V& () { return m_value; } 00068 00069 #if 0 00070 //do we need it anyway? 00080 void setValue(V& value) { m_value = value; } 00081 #endif 00082 00083 private: 00084 V m_value; 00085 }; 00086 00087 }} 00088 00089 #endif 00090