818cd084b520380fa92d663beee4b460caed8ddb
[profile/ivi/automotive-message-broker.git] / plugins / dbus / basicproperty.h
1 /*
2         Copyright (C) 2012  Intel Corporation
3
4         This library is free software; you can redistribute it and/or
5         modify it under the terms of the GNU Lesser General Public
6         License as published by the Free Software Foundation; either
7         version 2.1 of the License, or (at your option) any later version.
8
9         This library is distributed in the hope that it will be useful,
10         but WITHOUT ANY WARRANTY; without even the implied warranty of
11         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12         Lesser General Public License for more details.
13
14         You should have received a copy of the GNU Lesser General Public
15         License along with this library; if not, write to the Free Software
16         Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
17 */
18
19 #ifndef _BASICPROPERTY_H_
20 #define _BASICPROPERTY_H_
21
22 #include "abstractproperty.h"
23
24 template <typename T>
25 class BasicProperty: public AbstractProperty
26 {
27 public:
28         BasicProperty(string propertyName, string signature, Access access, AbstractDBusInterface *interface)
29                 :AbstractProperty(propertyName,signature,access,interface)
30         {
31
32         }
33
34         void setValue(T val)
35         {
36                 AbstractProperty::setValue<T>(val);
37         }
38
39         T value()
40         {
41                 return AbstractProperty::value<T>();
42         }
43
44         virtual GVariant* toGVariant()
45         {
46                 return g_variant_new(signature().c_str(), value());
47         }
48
49         virtual void fromGVariant(GVariant *value)
50         {
51
52         }
53 };
54
55 #endif