some serious changes
authorKevron Rees <kevron_m_rees@linux.intel.com>
Tue, 31 Jul 2012 21:00:25 +0000 (14:00 -0700)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Tue, 31 Jul 2012 21:00:25 +0000 (14:00 -0700)
54 files changed:
CMakeLists.txt
ambd/main.cpp
ambd/pluginloader.cpp
ambd/pluginloader.h
lib/CMakeLists.txt
lib/VehicleType.h [deleted file]
lib/abstractdbusinterface.cpp [deleted file]
lib/abstractdbusinterface.h [deleted file]
lib/abstractproperty.cpp [deleted file]
lib/abstractproperty.h [deleted file]
lib/abstractsink.cpp [moved from lib/fuellevelproperty.cpp with 54% similarity]
lib/abstractsink.h [new file with mode: 0644]
lib/abstractsource.cpp [moved from lib/engineoilproperty.cpp with 65% similarity]
lib/abstractsource.h [new file with mode: 0644]
lib/accelerationproperty.cpp [deleted file]
lib/accelerationproperty.h [deleted file]
lib/chime.cpp [deleted file]
lib/cruisecontrolstatus.cpp [deleted file]
lib/cruisecontrolstatus.h [deleted file]
lib/dbusinterfacemanager.cpp [deleted file]
lib/dbusinterfacemanager.h [deleted file]
lib/enginecoolantproperty.cpp [deleted file]
lib/enginecoolantproperty.h [deleted file]
lib/engineoilproperty.h [deleted file]
lib/enginespeedproperty.cpp [deleted file]
lib/enginespeedproperty.h [deleted file]
lib/fueleconomyproperty.cpp [deleted file]
lib/fueleconomyproperty.h [deleted file]
lib/fuellevelproperty.h [deleted file]
lib/fuelrangeproperty.cpp [deleted file]
lib/hornproperty.cpp [deleted file]
lib/hornproperty.h [deleted file]
lib/interiorlightstatusproperty.cpp [deleted file]
lib/interiorlightstatusproperty.h [deleted file]
lib/lightstatusproperty.cpp [deleted file]
lib/lightstatusproperty.h [deleted file]
lib/runningstatusinterface.cpp [deleted file]
lib/runningstatusinterface.h [deleted file]
lib/steeringwheelangleproperty.cpp [deleted file]
lib/steeringwheelangleproperty.h [deleted file]
lib/transmissiongearstatus.cpp [deleted file]
lib/transmissiongearstatus.h [deleted file]
lib/tripmeterproperty.cpp [deleted file]
lib/tripmeterproperty.h [deleted file]
lib/vehiclepowermodeproperty.cpp [deleted file]
lib/vehiclepowermodeproperty.h [deleted file]
lib/vehicleproperty.cpp [moved from lib/fuelrangeproperty.h with 63% similarity]
lib/vehicleproperty.h [moved from lib/chime.h with 65% similarity]
lib/vehiclespeed.cpp [deleted file]
lib/vehiclespeed.h [deleted file]
lib/wheelbrakeproperty.cpp [deleted file]
lib/wheelbrakeproperty.h [deleted file]
plugins/exampleplugin.cpp
plugins/exampleplugin.h

index 2e22c86..bc395a4 100644 (file)
@@ -15,7 +15,6 @@ set (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "The direc
 set (DOC_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME}" CACHE PATH "The directory the docs will be installed to")
 
 option(use_qtcore "Use QCoreApplication mainloop " OFF)
-option(nobdy_compat "Build nobdy compatibility plugin" OFF)
 
 find_library(libtool_LIBRARY ltdl DOC "Libtool libraries")
 find_path(libtool_INCLUDE_DIR ltdl.h DOC "Libtool headers")
index 7d821c7..9af9670 100644 (file)
@@ -42,7 +42,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 #endif
 
 #include "pluginloader.h"
-#include "dbusinterfacemanager.h"
+#include "abstractsource.h"
 
 using namespace std;
 
@@ -125,11 +125,10 @@ int main(int argc, char **argv)
        
        PluginLoader loader(plugin);
        
-       if(!loader.load())
+       AbstractSource* source = loader.loadSource();
+       if(source == nullptr) 
                return -1;
        
-       DBusInterfaceManager manager;
-
 #ifdef USE_QT_CORE
        
        app.exec();
index 428e333..1329740 100644 (file)
@@ -28,13 +28,13 @@ PluginLoader::PluginLoader(std::string pluginPath)
        
 }
 
-bool PluginLoader::load()
+AbstractSource* PluginLoader::loadSource()
 {
        if(lt_dlinit())
        {
                mErrorString = lt_dlerror();
                cerr<<"error initializing libtool: "<<__FILE__<<" - "<<__FUNCTION__<<":"<<__LINE__<<" "<<mErrorString<<endl;
-               return false;
+               return nullptr;
        }
        
        lt_dlerror();
@@ -45,7 +45,7 @@ bool PluginLoader::load()
        {
                mErrorString = lt_dlerror();
                cerr<<"error opening plugin: "<<mPluginPath<<" in "<<__FILE__<<" - "<<__FUNCTION__<<":"<<__LINE__<<" "<<mErrorString<<endl;
-               return false;
+               return nullptr;
        }
        
        f_create = (create_t *)lt_dlsym(handle, "create");
@@ -53,11 +53,11 @@ bool PluginLoader::load()
        //mErrorString = lt_dlerror();
        if(f_create) 
        {
-               f_create();
-               return true;
+               return f_create();
+               
        }
        
-       return false;
+       return nullptr;
 }
 
 std::string PluginLoader::errorString()
index ff08756..56274d1 100644 (file)
@@ -21,20 +21,20 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
 #include <string>
 #include <ltdl.h>
+#include "abstractsource.h"
 
 
-
-typedef void create_t();
+typedef AbstractSource* create_t();
 
 class PluginLoader
 {
 
 public:
-    PluginLoader(std::string pluginPath);
-        
-    bool load();
-    
-    std::string errorString();
+       PluginLoader(std::string pluginPath);
+
+       AbstractSource * loadSource();
+
+       std::string errorString();
         
 private:
        std::string mPluginPath;
index 5ddcd94..9d5e1de 100644 (file)
@@ -1,6 +1,6 @@
 
-set(amb_sources steeringwheelangleproperty.cpp accelerationproperty.cpp enginecoolantproperty.cpp engineoilproperty.cpp fuelrangeproperty.cpp fuellevelproperty.cpp chime.cpp hornproperty.cpp interiorlightstatusproperty.cpp lightstatusproperty.cpp wheelbrakeproperty.cpp cruisecontrolstatus.cpp transmissiongearstatus.cpp tripmeterproperty.cpp fueleconomyproperty.cpp vehiclepowermodeproperty.cpp enginespeedproperty.cpp runningstatusinterface.cpp vehiclespeed.cpp abstractdbusinterface.cpp abstractproperty.cpp dbusinterfacemanager.cpp debugout.cpp)
-set(amb_headers_install dbusinterfacemanager.h runningstatusinterface.h abstractproperty.h vehiclespeed.h hornproperty.h interiorlightstatusproperty.h lightstatusproperty.h wheelbrakeproperty.h cruisecontrolstatus.h transmissiongearstatus.h tripmeterproperty.h fueleconomyproperty.h vehiclepowermodeproperty.h enginespeedproperty.h chime.h)
+set(amb_sources abstractsink.cpp vehicleproperty.cpp abstractsource.cpp debugout.cpp)
+set(amb_headers_install vehicleproperty.h debugout.h abstractsource.h)
 include_directories( ${include_dirs} )
 add_library(amb SHARED ${amb_sources})
 
diff --git a/lib/VehicleType.h b/lib/VehicleType.h
deleted file mode 100644 (file)
index 5e203d0..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-
-namespace VehicleInfo
-{
-       enum VehicleType
-       {
-               Sedan=0,
-               Coupe,
-               Cabriole,
-               Roadster,
-               SUV,
-               Truck
-       };
-}
\ No newline at end of file
diff --git a/lib/abstractdbusinterface.cpp b/lib/abstractdbusinterface.cpp
deleted file mode 100644 (file)
index fba0e3a..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
-Copyright (C) 2012 Intel Corporation
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library 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
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include "abstractdbusinterface.h"
-#include "debugout.h"
-#include <boost/algorithm/string.hpp>
-#include <gio/gio.h>
-
-#include "abstractproperty.h"
-
-unordered_map<string, AbstractDBusInterface*> AbstractDBusInterface::interfaceMap;
-
-AbstractDBusInterface::AbstractDBusInterface(string interfaceName, string objectPath)
-: mInterfaceName(interfaceName), mObjectPath(objectPath)
-{
-       mConnection = nullptr;
-
-       interfaceMap[interfaceName] = this;
-       introspectionXml ="<node>" ;
-       introspectionXml += "<interface name='"+ interfaceName + "' >";
-}
-
-void AbstractDBusInterface::addProperty(AbstractProperty* property)
-{
-       string nameToLower = property->name();
-       boost::algorithm::to_lower<string>(nameToLower);
-       
-       ///see which properties are supported:
-       introspectionXml +=     "<property type='"+ property->signature() + "' name='"+ property->name()+"' access='read' />"
-       "<signal name='" + property->name() + "' >"
-       "       <arg type='"+ property->signature() + "' name='" + nameToLower + "' direction='out' />"
-       "</signal>";
-       
-       properties[property->name()] = property;
-}
-
-void AbstractDBusInterface::registerObject(GDBusConnection* connection)
-{
-       mConnection = connection;
-       
-       if(introspectionXml.empty())
-       {
-               cerr<<"no interface to export: "<<mInterfaceName<<endl;
-               throw -1;
-       }
-
-       introspectionXml += "</interface>";
-       introspectionXml += "</node>";
-       
-       GError* error=NULL;
-
-       GDBusNodeInfo* introspection = g_dbus_node_info_new_for_xml(introspectionXml.c_str(), &error);
-       
-       if(!introspection)
-       {
-               cerr<<"Error in "<<__FILE__<<" - "<<__FUNCTION__<<":"<<__LINE__<<endl;
-               cerr<<error->message<<endl;
-               cerr<<"probably bad xml:"<<endl;
-               cerr<<introspectionXml<<endl;
-               return;
-       }
-
-       GDBusInterfaceInfo* mInterfaceInfo = g_dbus_node_info_lookup_interface(introspection, mInterfaceName.c_str());
-       
-       const GDBusInterfaceVTable vtable = { NULL, AbstractDBusInterface::getProperty, AbstractDBusInterface::setProperty };
-       
-       guint regId = g_dbus_connection_register_object(connection, mObjectPath.c_str(), mInterfaceInfo, &vtable, NULL, NULL, &error);
-       
-       if(error) throw -1;
-       
-       g_assert(regId > 0);
-}
-
-void AbstractDBusInterface::updateValue(AbstractProperty *property)
-{
-       if(mConnection == nullptr)
-       {
-               return;
-       }
-
-       GError *error = NULL;
-       g_dbus_connection_emit_signal(mConnection, NULL, mObjectPath.c_str(), mInterfaceName.c_str(), property->name().c_str(), g_variant_new("(v)",property->toGVariant()), &error);
-
-       if(error)
-       {
-               throw -1;
-       }
-}
-
-GVariant* AbstractDBusInterface::getProperty(GDBusConnection* connection, const gchar* sender, const gchar* objectPath, const gchar* interfaceName, const gchar* propertyName, GError** error, gpointer userData)
-{
-       *error = NULL;
-       if(interfaceMap.count(interfaceName))
-       {
-               GVariant* value = interfaceMap[interfaceName]->getProperty(propertyName);
-               return value;
-       }
-       debugOut("No interface for" + string(interfaceName));
-       return nullptr;
-}
-
-gboolean AbstractDBusInterface::setProperty(GDBusConnection* connection, const gchar* sender, const gchar* objectPath, const gchar* interfaceName, const gchar* propertyName, GVariant* value, GError** error, gpointer userData)
-{
-       if(interfaceMap.count(interfaceName))
-       {
-               interfaceMap[interfaceName]->setProperty(propertyName, value);
-               return true;
-       }
-
-       return false;
-}
-
diff --git a/lib/abstractdbusinterface.h b/lib/abstractdbusinterface.h
deleted file mode 100644 (file)
index ff7a6e9..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
-Copyright (C) 2012 Intel Corporation
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library 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
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#ifndef ABSTRACTDBUSINTERFACE_H
-#define ABSTRACTDBUSINTERFACE_H
-
-#include <string>
-#include <functional>
-#include <unordered_map>
-#include <gio/gio.h>
-#include <boost/any.hpp>
-
-class AbstractProperty;
-
-using namespace std;
-
-class AbstractDBusInterface
-{
-
-public:
-       AbstractDBusInterface(string interfaceName, string objectPath);
-
-       
-       void registerObject(GDBusConnection* connection);
-       
-       void addProperty(AbstractProperty* property);
-       virtual void updateValue(AbstractProperty* property);
-       
-protected:
-       
-       static GVariant *getProperty(GDBusConnection * connection, const gchar * sender, const gchar *objectPath, const gchar *interfaceName, const gchar * propertyName, GError** error, gpointer userData);
-       static gboolean setProperty(GDBusConnection * connection, const gchar * sender, const gchar *objectPath, const gchar *interfaceName, const gchar * propertyName, GVariant *value, GError** error, gpointer userData);
-    
-       virtual void setProperty(string propertyName, GVariant * value) = 0;
-       virtual GVariant * getProperty(string propertyName) = 0;
-       
-       unordered_map<string, AbstractProperty*> properties;
-
-private:
-       string mInterfaceName;
-       string mObjectPath;
-       string introspectionXml;
-       GDBusConnection * mConnection;
-       static unordered_map<string, AbstractDBusInterface*> interfaceMap;
-};
-
-#endif // ABSTRACTDBUSINTERFACE_H
diff --git a/lib/abstractproperty.cpp b/lib/abstractproperty.cpp
deleted file mode 100644 (file)
index 111f2bd..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-Copyright (C) 2012 Intel Corporation
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library 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
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-
-#include "abstractproperty.h"
-#include "abstractdbusinterface.h"
-
-AbstractProperty::AbstractProperty(string pn, string sig, Access access, AbstractDBusInterface* interface)
-       : mPropertyName(pn), mSignature(sig), mAccess(access), mInterface(interface)
-{
-       interface->addProperty(this);
-}
-
-void AbstractProperty::updateValue()
-{
-       mInterface->updateValue(this);
-}
diff --git a/lib/abstractproperty.h b/lib/abstractproperty.h
deleted file mode 100644 (file)
index 3830681..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
-Copyright (C) 2012 Intel Corporation
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library 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
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#ifndef ABSTRACTPROPERTY_H
-#define ABSTRACTPROPERTY_H
-
-#include <string>
-#include <functional>
-#include <boost/any.hpp>
-#include <glib.h>
-
-#include "debugout.h"
-
-class AbstractDBusInterface;
-
-using namespace std;
-
-typedef function<void (boost::any)> SetterFunc;
-
-class AbstractProperty
-{
-
-public:
-
-       enum Access {
-               Read,
-               Write,
-               ReadWrite
-       };
-
-       AbstractProperty(string propertyName, string signature, Access access, AbstractDBusInterface* interface);
-       
-       virtual void setSetterFunction(SetterFunc setterFunc)
-       {
-               mSetterFunc = setterFunc;
-       }
-       
-       virtual string signature()
-       {
-               return mSignature;
-       }
-       
-       virtual string name() 
-       {
-               return mPropertyName;
-       }
-
-       virtual Access access()
-       {
-               return mAccess;
-       }
-       
-       virtual GVariant* toGVariant() = 0;
-       virtual void fromGVariant(GVariant *value) = 0;
-
-       template<typename T>
-       void setValue(T val)
-       {
-               mValue = val;
-               updateValue();
-       }
-
-       template<typename T>
-       T value()
-       {
-               return boost::any_cast<T>(mValue);
-       }
-       
-protected: ///methods:
-
-       void updateValue();
-       
-protected:
-       
-       boost::any mValue;
-       string mPropertyName;
-       string mSignature;
-       SetterFunc mSetterFunc;
-       Access mAccess;
-       
-       AbstractDBusInterface* mInterface;
-};
-
-#endif // ABSTRACTPROPERTY_H
similarity index 54%
rename from lib/fuellevelproperty.cpp
rename to lib/abstractsink.cpp
index bdc23ad..0eeb27a 100644 (file)
@@ -1,5 +1,4 @@
 /*
-    <one line to give the library's name and an idea of what it does.>
     Copyright (C) 2012  Intel Corporation
 
     This library is free software; you can redistribute it and/or
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
-#include "fuellevelproperty.h"
-#include "runningstatusinterface.h"
 
-void FuelLevelProperty::fromGVariant(GVariant* value)
+#include "abstractsink.h"
+
+AbstractSink::AbstractSink()
 {
 
 }
 
-GVariant* FuelLevelProperty::toGVariant()
+void AbstractSink::setProperty(VehicleProperty::Property prop, boost::any value)
+{
+       setPropertyCb(prop, value);
+}
+
+void AbstractSink::setSupported(PropertyList properties)
 {
-       return g_variant_new_byte(value());
+       mSupported = properties;
 }
 
-FuelLevelProperty::FuelLevelProperty()
-       :AbstractProperty("FuelLevel", "y", AbstractProperty::Read, RunningStatusInterface::iface())
+void AbstractSink::subscribeToProperty(VehicleProperty::Property property)
 {
-       setValue(0);
+       subscribeToPropertyCb(property);
 }
 
-void FuelLevelProperty::setValue(uint8_t val)
+PropertyList AbstractSink::supported()
 {
-       AbstractProperty::setValue<uint8_t>(val);
+       return mSupported;
 }
 
-uint8_t FuelLevelProperty::value()
+void AbstractSink::unsubscribeToProperty(VehicleProperty::Property property)
 {
-       return  AbstractProperty::value<uint8_t>();
+       unsubscribeToPropertyCb(property);
 }
 
-FuelLevelProperty& FuelLevelProperty::operator =(uint8_t const &val)
+void AbstractSinkManager::sinkCreated(AbstractSink* sink)
 {
-       this->setValue(val);
-       return *this;
+       sinkCreatedCb(sink);
 }
 
+void AbstractSinkManager::sinkRemoved(AbstractSink* sink)
+{
+       sinkRemovedCb(sink);
+}
diff --git a/lib/abstractsink.h b/lib/abstractsink.h
new file mode 100644 (file)
index 0000000..4d9a378
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+    Copyright (C) 2012  Intel Corporation
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+
+#ifndef ABSTRACTSINK_H
+#define ABSTRACTSINK_H
+
+#include <string>
+#include <list>
+#include <functional>
+
+#include "vehicleproperty.h"
+
+using namespace std;
+
+typedef function<void (VehicleProperty::Property, boost::any)> SetPropertySignal;
+typedef function<void (VehicleProperty::Property)> SubscriptionSignal;
+
+typedef list<AbstractSink*> SinkList;
+typedef function<void (AbstractSink*)> SinkSignal;
+
+class AbstractSink
+{
+
+public:
+       AbstractSink();
+       
+       void setProperty(VehicleProperty::Property, boost::any);
+       void subscribeToProperty(VehicleProperty::Property property);
+       void unsubscribeToProperty(VehicleProperty::Property property);
+       PropertyList supported(); 
+       
+       void setSupported(PropertyList properties);
+       
+       ///Pure virtual methods:
+       
+       virtual string name() = 0;
+       virtual void propertyChanged(VehicleProperty::Property property, boost::any value) = 0;
+       virtual PropertyList subscriptions() = 0;
+       
+       
+private:
+       SetPropertySignal setPropertyCb;
+       SubscriptionSignal subscribeToPropertyCb;
+       SubscriptionSignal unsubscribeToPropertyCb;
+       PropertyList mSupported;
+};
+
+class AbstractSinkManager
+{
+public:
+       virtual SinkList sinks() = 0;
+       
+       void sinkCreated(AbstractSink*);
+       void sinkRemoved(AbstractSink*);
+       
+private:
+       SinkSignal sinkCreatedCb;
+       SinkSignal sinkRemovedCb;
+};
+
+#endif // ABSTRACTSINK_H
similarity index 65%
rename from lib/engineoilproperty.cpp
rename to lib/abstractsource.cpp
index 66a72dd..4f49968 100644 (file)
 */
 
 
-#include "engineoilproperty.h"
-#include "runningstatusinterface.h"
-void EngineOilProperty::fromGVariant(GVariant* value)
+#include "abstractsource.h"
+
+AbstractSource::AbstractSource()
 {
 
 }
 
-GVariant* EngineOilProperty::toGVariant()
+void AbstractSource::propertyChanged(VehicleProperty::Property property, boost::any value)
 {
-       EngineOil v = *this;
-       return g_variant_new(signature().c_str(), v.remaining, v.temperature, v.pressure);
+       mPropertyChangedCb(property, value);
 }
 
-EngineOilProperty::EngineOilProperty()
-       :AbstractProperty("EngineOil","(yyq)",AbstractProperty::Read,RunningStatusInterface::iface())
+void AbstractSource::setPropertyChangedCb(PropertyChangedSignal propertyChangedCb)
 {
-       setValue<EngineOil>(EngineOil());
+       mPropertyChangedCb = propertyChangedCb;
 }
 
-
-
diff --git a/lib/abstractsource.h b/lib/abstractsource.h
new file mode 100644 (file)
index 0000000..4c4c2fb
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+    Copyright (C) 2012  Intel Corporation
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+
+#ifndef ABSTRACTSOURCE_H
+#define ABSTRACTSOURCE_H
+
+#include <string>
+#include <list>
+#include <functional>
+#include <boost/any.hpp>
+#include "vehicleproperty.h"
+
+using namespace std;
+
+typedef function<void (VehicleProperty::Property, boost::any)> PropertyChangedSignal;
+
+class AbstractSource
+{
+
+public:
+       AbstractSource();
+
+       void propertyChanged(VehicleProperty::Property property, boost::any value);
+
+       void setPropertyChangedCb(PropertyChangedSignal propertyChangedCb);
+       
+       ///pure virtual methods:
+
+       virtual string name() = 0;
+       virtual void setProperty(VehicleProperty::Property property, boost::any value) = 0;
+       virtual void subscribeToPropertyChanges(VehicleProperty::Property property) = 0;
+       virtual void unsubscribeToPropertyChanges(VehicleProperty::Property property) = 0;
+       virtual PropertyList supported() = 0;
+       
+
+private:
+       PropertyChangedSignal mPropertyChangedCb;
+    
+};
+
+#endif // ABSTRACTSOURCE_H
diff --git a/lib/accelerationproperty.cpp b/lib/accelerationproperty.cpp
deleted file mode 100644 (file)
index 7cdb989..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-    <one line to give the library's name and an idea of what it does.>
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include "accelerationproperty.h"
-#include "runningstatusinterface.h"
-void AccelerationProperty::fromGVariant(GVariant* value)
-{
-
-}
-
-GVariant* AccelerationProperty::toGVariant()
-{
-       Acceleration acl = *this;
-       return g_variant_new(signature().c_str(),acl.x, acl.y, acl.z);
-}
-
-AccelerationProperty::AccelerationProperty()
-       : AbstractProperty("Acceleration","(ddd)",AbstractProperty::Read,RunningStatusInterface::iface())
-{
-       setValue<Acceleration>(Acceleration());
-}
-
diff --git a/lib/accelerationproperty.h b/lib/accelerationproperty.h
deleted file mode 100644 (file)
index c1a5e9d..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-    <one line to give the library's name and an idea of what it does.>
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#ifndef ACCELERATIONPROPERTY_H
-#define ACCELERATIONPROPERTY_H
-
-#include <abstractproperty.h>
-
-
-class Acceleration
-{
-public:
-       Acceleration() : x(0),y(0),z(0) { }
-       Acceleration(Acceleration const & other)
-       {
-               x = other.x;
-               y = other.y;
-               z = other.z;
-       }
-
-       Acceleration & operator = (Acceleration const & other)
-       {
-               x = other.x;
-               y = other.y;
-               z = other.z;
-
-               return *this;
-       }
-
-       double x;
-       double y;
-       double z;
-};
-
-class AccelerationProperty : public AbstractProperty
-{
-
-public:
-       operator Acceleration()
-       {
-               return value<Acceleration>();
-       }
-
-       AccelerationProperty & operator = (Acceleration const & v)
-       {
-               setValue<Acceleration>(v);
-       }
-
-       virtual void fromGVariant(GVariant* value);
-       virtual GVariant* toGVariant();
-       AccelerationProperty();
-};
-
-#endif // ACCELERATIONPROPERTY_H
diff --git a/lib/chime.cpp b/lib/chime.cpp
deleted file mode 100644 (file)
index bead6e9..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-    <one line to give the library's name and an idea of what it does.>
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include "chime.h"
-#include "runningstatusinterface.h"
-
-void Chime::fromGVariant(GVariant* value)
-{
-
-}
-
-GVariant* Chime::toGVariant()
-{
-       return g_variant_new_boolean(value());
-}
-
-Chime::Chime()
-       :AbstractProperty("Chime","b",AbstractProperty::Read,RunningStatusInterface::iface())
-{
-       setValue(false);
-}
-
-void Chime::setValue(bool val)
-{
-       AbstractProperty::setValue<bool>(val);
-}
-
-bool Chime::value()
-{
-       return AbstractProperty::value<bool>();
-}
-
diff --git a/lib/cruisecontrolstatus.cpp b/lib/cruisecontrolstatus.cpp
deleted file mode 100644 (file)
index 463eb79..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-
-#include "cruisecontrolstatus.h"
-#include "runningstatusinterface.h"
-
-#include "debugout.h"
-
-void CruiseControlStatusProperty::setValue(CruiseControlStatus status)
-{
-       AbstractProperty::setValue<CruiseControlStatus>(status);
-}
-
-CruiseControlStatus CruiseControlStatusProperty::value()
-{
-       return AbstractProperty::value<CruiseControlStatus>();
-}
-
-
-void CruiseControlStatusProperty::fromGVariant(GVariant* value)
-{
-
-}
-
-GVariant* CruiseControlStatusProperty::toGVariant()
-{
-       return g_variant_new(signature().c_str(), value().activated, value().speed);
-}
-
-CruiseControlStatusProperty::CruiseControlStatusProperty()
-: AbstractProperty("CruiseControlStatus", "(bq)", AbstractProperty::Read, RunningStatusInterface::iface())
-{
-       setValue(CruiseControlStatus());
-}
-
diff --git a/lib/cruisecontrolstatus.h b/lib/cruisecontrolstatus.h
deleted file mode 100644 (file)
index b014b5e..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-
-#ifndef CRUISECONTROLSTATUS_H
-#define CRUISECONTROLSTATUS_H
-
-#include <abstractproperty.h>
-
-class CruiseControlStatus
-{
-public:
-       CruiseControlStatus() : activated(false), speed(0) { }
-       
-       CruiseControlStatus(bool active, uint16_t spd)
-       : activated(active), speed(spd)
-       { }
-       
-       CruiseControlStatus(const CruiseControlStatus& other)
-       {
-               activated = other.activated;
-               speed = other.speed;
-       }
-       
-       CruiseControlStatus& operator = (CruiseControlStatus other)
-       {
-               activated = other.activated;
-               speed = other.speed;
-               
-               return *this;
-       }
-       
-       bool operator == (CruiseControlStatus &other)
-       {
-               return activated == other.activated && speed == other.speed;
-       }
-       
-       bool activated;
-       uint16_t speed;
-       
-};
-
-class CruiseControlStatusProperty : public AbstractProperty
-{
-public:
-
-       operator CruiseControlStatus()
-       {
-               return value();
-       }
-
-       CruiseControlStatusProperty & operator = (CruiseControlStatus const & v)
-       {
-               setValue(v);
-               return *this;
-       }
-
-       void setValue(CruiseControlStatus status);
-       CruiseControlStatus value();
-       
-       virtual void fromGVariant(GVariant* value);
-       virtual GVariant* toGVariant();
-       CruiseControlStatusProperty();
-};
-
-#endif // CRUISECONTROLSTATUS_H
diff --git a/lib/dbusinterfacemanager.cpp b/lib/dbusinterfacemanager.cpp
deleted file mode 100644 (file)
index ef7c346..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-Copyright (C) 2012 Intel Corporation
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library 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
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include "dbusinterfacemanager.h"
-#include "runningstatusinterface.h"
-
-#include <string>
-
-using namespace std;
-
-static void
-on_bus_acquired (GDBusConnection *connection, const gchar *name, gpointer user_data)
-{
-       RunningStatusInterface::iface()->registerObject(connection);
-}
-
-static void
-on_name_acquired (GDBusConnection *connection, const gchar *name, gpointer user_data)
-{
-}
-
-static void
-on_name_lost (GDBusConnection *connection, const gchar *name, gpointer user_data)
-{
-}
-
-
-
-DBusInterfaceManager::DBusInterfaceManager()
-{
-       g_type_init();
-
-       ownerId = g_bus_own_name(G_BUS_TYPE_SESSION,
-                                       DBusServiceName,
-                                       G_BUS_NAME_OWNER_FLAGS_NONE,
-                                       on_bus_acquired,
-                                       on_name_acquired,
-                                       on_name_lost,
-                                       this,
-                                       NULL);
-
-       ///TODO: instantiate other interfaces here!
-}
-
-DBusInterfaceManager::~DBusInterfaceManager()
-{
-       g_bus_unown_name(ownerId);
-}
-
-
diff --git a/lib/dbusinterfacemanager.h b/lib/dbusinterfacemanager.h
deleted file mode 100644 (file)
index 54f42c9..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-Copyright (C) 2012 Intel Corporation
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library 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
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-
-#ifndef DBUSINTERFACEMANAGER_H
-#define DBUSINTERFACEMANAGER_H
-
-class DBusInterfaceManager
-{
-
-public:
-       DBusInterfaceManager();
-       ~DBusInterfaceManager();
-    
-    
-private:
-       
-       unsigned int ownerId;
-
-};
-
-#endif // DBUSINTERFACEMANAGER_H
diff --git a/lib/enginecoolantproperty.cpp b/lib/enginecoolantproperty.cpp
deleted file mode 100644 (file)
index f6de87e..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-    <one line to give the library's name and an idea of what it does.>
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include "enginecoolantproperty.h"
-#include "runningstatusinterface.h"
-
-void EngineCoolantProperty::fromGVariant(GVariant* value)
-{
-
-}
-
-GVariant* EngineCoolantProperty::toGVariant()
-{
-       EngineCoolant val = value<EngineCoolant>();
-       return g_variant_new(signature().c_str(), val.level, val.temperature);
-}
-
-EngineCoolantProperty::EngineCoolantProperty()
-       :AbstractProperty("EngineCoolant", "(yy)", AbstractProperty::Read, RunningStatusInterface::iface())
-{
-       setValue<EngineCoolant>(EngineCoolant());
-}
-
diff --git a/lib/enginecoolantproperty.h b/lib/enginecoolantproperty.h
deleted file mode 100644 (file)
index b88445f..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-    <one line to give the library's name and an idea of what it does.>
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#ifndef ENGINECOOLANTPROPERTY_H
-#define ENGINECOOLANTPROPERTY_H
-
-#include <abstractproperty.h>
-
-class EngineCoolant
-{
-public:
-       EngineCoolant(): temperature(0), level(0) {}
-       EngineCoolant(EngineCoolant const & other)
-       {
-               temperature = other.temperature;
-               level = other.level;
-       }
-
-       EngineCoolant& operator = (EngineCoolant const &other)
-       {
-               temperature = other.temperature;
-               level = other.level;
-               return *this;
-       }
-
-       bool operator == (const EngineCoolant& other) const
-       {
-               return temperature == other.temperature && level == other.level;
-       }
-
-
-
-       uint8_t temperature;
-       uint8_t level;
-};
-
-class EngineCoolantProperty : public AbstractProperty
-{
-
-public:
-       virtual void fromGVariant(GVariant* value);
-       virtual GVariant* toGVariant();
-       EngineCoolantProperty();
-
-       EngineCoolantProperty& operator=(EngineCoolant const & other)
-       {
-               setValue<EngineCoolant>(other);
-               return *this;
-       }
-
-       operator EngineCoolant()
-       {
-               return value<EngineCoolant>();
-       }
-
-};
-
-#endif // ENGINECOOLANTPROPERTY_H
diff --git a/lib/engineoilproperty.h b/lib/engineoilproperty.h
deleted file mode 100644 (file)
index ca63663..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-
-#ifndef ENGINEOILPROPERTY_H
-#define ENGINEOILPROPERTY_H
-
-#include <abstractproperty.h>
-
-class EngineOil 
-{
-public:
-       EngineOil():remaining(0), temperature(0), pressure(0) { }
-       
-       EngineOil(EngineOil const & other)
-       {
-               remaining = other.remaining;
-               temperature = other.temperature;
-               pressure = other.pressure;
-       }
-
-       EngineOil & operator = (EngineOil const & other)
-       {
-               remaining = other.remaining;
-               temperature = other.temperature;
-               pressure = other.pressure;
-
-               return *this;
-       }
-
-       bool operator == (EngineOil const & other)
-       {
-               return remaining == other.remaining &&
-                               temperature == other.temperature &&
-                               pressure == other.pressure;
-       }
-
-       uint8_t remaining;
-       uint8_t temperature;
-       uint16_t pressure;
-};
-
-class EngineOilProperty : public AbstractProperty
-{
-
-public:
-
-       operator EngineOil()
-       {
-               return value<EngineOil>();
-       }
-
-       EngineOilProperty & operator = (EngineOil const & val)
-       {
-               AbstractProperty::setValue<EngineOil>(val);
-               return *this;
-       }
-
-       virtual void fromGVariant(GVariant* value);
-       virtual GVariant* toGVariant();
-
-       EngineOilProperty();
-    
-    
-};
-
-#endif // ENGINEOILPROPERTY_H
diff --git a/lib/enginespeedproperty.cpp b/lib/enginespeedproperty.cpp
deleted file mode 100644 (file)
index 4f56910..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-    <one line to give the library's name and an idea of what it does.>
-    Copyright (C) 2012  Kevron Rees <email>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-
-#include "enginespeedproperty.h"
-#include "runningstatusinterface.h"
-#include "debugout.h"
-
-#include <glib.h>
-
-void EngineSpeedProperty::setValue(uint16_t v)
-{    
-       AbstractProperty::setValue<uint16_t>(v);
-}
-
-
-void EngineSpeedProperty::fromGVariant(GVariant* value)
-{
-        setValue((uint16_t)g_variant_get_uint16(value));
-}
-
-GVariant* EngineSpeedProperty::toGVariant()
-{
-       return g_variant_new_uint16(AbstractProperty::value<uint16_t>());
-}
-
-EngineSpeedProperty::EngineSpeedProperty()
-: AbstractProperty("EngineSpeed", "q", AbstractProperty::Read, RunningStatusInterface::iface())
-{
-       setValue(0);
-}
-
diff --git a/lib/enginespeedproperty.h b/lib/enginespeedproperty.h
deleted file mode 100644 (file)
index 293bad6..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-
-#ifndef ENGINESPEEDPROPERTY_H
-#define ENGINESPEEDPROPERTY_H
-
-#include "abstractproperty.h"
-
-
-class EngineSpeedProperty : public AbstractProperty
-{
-
-public:
-
-       operator uint16_t()
-       {
-               return value();
-       }
-
-       EngineSpeedProperty & operator = (uint16_t const &v)
-       {
-               setValue(v);
-               return *this;
-       }
-
-       void setValue(uint16_t v);
-       uint16_t value() { return AbstractProperty::value<uint16_t>(); }
-       virtual void fromGVariant(GVariant* value);
-       virtual GVariant* toGVariant();
-       EngineSpeedProperty();
-
-};
-
-#endif // ENGINESPEEDPROPERTY_H
diff --git a/lib/fueleconomyproperty.cpp b/lib/fueleconomyproperty.cpp
deleted file mode 100644 (file)
index e44af17..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-
-#include "fueleconomyproperty.h"
-#include "runningstatusinterface.h"
-
-void FuelEconomyProperty::fromGVariant(GVariant* value)
-{
-       mValue = (uint16_t)g_variant_get_uint16(value);
-}
-
-GVariant* FuelEconomyProperty::toGVariant()
-{
-       return g_variant_new_uint16(AbstractProperty::value<uint16_t>());
-}
-
-FuelEconomyProperty::FuelEconomyProperty()
-: AbstractProperty("FuelEconomy","q",AbstractProperty::Read, RunningStatusInterface::iface())
-{
-       setValue(0);
-}
-
-void FuelEconomyProperty::setValue(uint16_t val)
-{
-       AbstractProperty::setValue<uint16_t>(val);
-}
diff --git a/lib/fueleconomyproperty.h b/lib/fueleconomyproperty.h
deleted file mode 100644 (file)
index 2f75787..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-
-#ifndef FUELECONOMYPROPERTY_H
-#define FUELECONOMYPROPERTY_H
-
-#include <abstractproperty.h>
-
-
-class FuelEconomyProperty : public AbstractProperty
-{
-
-public:
-
-       operator uint16_t()
-       {
-               return value();
-       }
-
-       FuelEconomyProperty & operator = (uint16_t const &v)
-       {
-               setValue(v);
-               return *this;
-       }
-
-       void setValue(uint16_t val);
-       uint16_t value() { return AbstractProperty::value<uint16_t>(); }
-       virtual void fromGVariant(GVariant* value);
-       virtual GVariant* toGVariant();
-       FuelEconomyProperty();
-       
-};
-
-#endif // FUELECONOMYPROPERTY_H
diff --git a/lib/fuellevelproperty.h b/lib/fuellevelproperty.h
deleted file mode 100644 (file)
index 85b417f..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-    <one line to give the library's name and an idea of what it does.>
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#ifndef FUELLEVELPROPERTY_H
-#define FUELLEVELPROPERTY_H
-
-#include <abstractproperty.h>
-
-
-class FuelLevelProperty : public AbstractProperty
-{
-
-public:
-       void setValue(uint8_t val);
-       uint8_t value();
-
-       FuelLevelProperty& operator = (uint8_t const &val);
-
-       operator uint8_t()
-       {
-               return value();
-       }
-
-       virtual void fromGVariant(GVariant* value);
-       virtual GVariant* toGVariant();
-       FuelLevelProperty();
-};
-
-#endif // FUELLEVELPROPERTY_H
diff --git a/lib/fuelrangeproperty.cpp b/lib/fuelrangeproperty.cpp
deleted file mode 100644 (file)
index 9a7f58e..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-    <one line to give the library's name and an idea of what it does.>
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include "fuelrangeproperty.h"
-#include "runningstatusinterface.h"
-void FuelRangeProperty::fromGVariant(GVariant* value)
-{
-
-}
-
-GVariant* FuelRangeProperty::toGVariant()
-{
-       return g_variant_new_uint16(value<uint16_t>());
-}
-
-FuelRangeProperty::FuelRangeProperty()
-       :AbstractProperty("FuelRange","q",AbstractProperty::Read, RunningStatusInterface::iface())
-{
-       setValue<uint16_t>(0);
-}
-
-FuelRangeProperty& FuelRangeProperty::operator=(uint16_t const & other)
-{
-       setValue<uint16_t>(other);
-       return *this;
-}
-
diff --git a/lib/hornproperty.cpp b/lib/hornproperty.cpp
deleted file mode 100644 (file)
index 4faa30b..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-    <one line to give the library's name and an idea of what it does.>
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include "hornproperty.h"
-#include "runningstatusinterface.h"
-
-void HornProperty::setValue(bool val)
-{
-    AbstractProperty::setValue<bool>(val);
-}
-
-bool HornProperty::value()
-{
-    return AbstractProperty::value<bool>();
-}
-
-
-void HornProperty::fromGVariant(GVariant* value)
-{
-
-}
-
-GVariant* HornProperty::toGVariant()
-{
-    return g_variant_new_boolean(value());
-}
-
-HornProperty::HornProperty()
-    :AbstractProperty("Horn","b",AbstractProperty::Read,RunningStatusInterface::iface())
-{
-       setValue(false);
-}
-
diff --git a/lib/hornproperty.h b/lib/hornproperty.h
deleted file mode 100644 (file)
index c19cd30..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-    <one line to give the library's name and an idea of what it does.>
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#ifndef HORNPROPERTY_H
-#define HORNPROPERTY_H
-
-#include <abstractproperty.h>
-
-
-class HornProperty : public AbstractProperty
-{
-
-public:
-       operator bool()
-       {
-               return value();
-       }
-
-       HornProperty & operator = (bool v)
-       {
-               setValue(v);
-               return *this;
-       }
-
-       void setValue(bool);
-       bool value();
-       virtual void fromGVariant(GVariant* value);
-       virtual GVariant* toGVariant();
-       HornProperty();
-};
-
-#endif // HORNPROPERTY_H
diff --git a/lib/interiorlightstatusproperty.cpp b/lib/interiorlightstatusproperty.cpp
deleted file mode 100644 (file)
index 6cbe703..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-
-#include "interiorlightstatusproperty.h"
-#include "runningstatusinterface.h"
-
-void InteriorLightStatusProperty::setValue(InteriorLightStatusProperty::InteriorLightStatus val)
-{
-       AbstractProperty::setValue<InteriorLightStatusProperty::InteriorLightStatus>(val);
-}
-
-InteriorLightStatusProperty::InteriorLightStatus InteriorLightStatusProperty::value()
-{
-       return AbstractProperty::value<InteriorLightStatusProperty::InteriorLightStatus>();
-}
-
-
-void InteriorLightStatusProperty::fromGVariant(GVariant* value)
-{
-
-}
-
-GVariant* InteriorLightStatusProperty::toGVariant()
-{
-       GVariantBuilder builder;
-       
-       g_variant_builder_init(&builder, G_VARIANT_TYPE(signature().c_str()));
-       
-       InteriorLightStatusProperty::InteriorLightStatus lights = value();
-       
-       for(InteriorLightStatus::const_iterator itr = lights.begin(); itr != lights.end(); itr++)
-       {
-               g_variant_builder_add(&builder, "{yb}", (char)(*itr).first, (*itr).second);
-       }
-       
-       GVariant *variant = g_variant_new(signature().c_str(), &builder);
-       g_variant_builder_unref(&builder);
-       
-       return variant;
-}
-
-InteriorLightStatusProperty::InteriorLightStatusProperty()
-: AbstractProperty("InteriorLightStatus","a{yb}", AbstractProperty::Read, RunningStatusInterface::iface())
-{
-       setValue(InteriorLightStatusProperty::InteriorLightStatus());
-}
-
diff --git a/lib/interiorlightstatusproperty.h b/lib/interiorlightstatusproperty.h
deleted file mode 100644 (file)
index 03b8556..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-
-#ifndef INTERIORLIGHTSTATUSPROPERTY_H
-#define INTERIORLIGHTSTATUSPROPERTY_H
-
-#include <abstractproperty.h>
-#include <map>
-
-class InteriorLightStatusProperty : public AbstractProperty
-{
-
-public:
-       enum InteriorLight {
-               Driver = 0,
-               Passenger = 1,
-               Center = 2
-       };
-
-       typedef std::map<InteriorLight, bool> InteriorLightStatus;
-
-       operator InteriorLightStatus()
-       {
-               return value();
-       }
-
-       InteriorLightStatusProperty & operator = (InteriorLightStatus const & v)
-       {
-               setValue(v);
-               return *this;
-       }
-       
-       void setValue(InteriorLightStatusProperty::InteriorLightStatus val);
-       InteriorLightStatusProperty::InteriorLightStatus value();
-       
-       virtual void fromGVariant(GVariant* value);
-       virtual GVariant* toGVariant();
-       InteriorLightStatusProperty();
-};
-
-#endif // INTERIORLIGHTSTATUSPROPERTY_H
diff --git a/lib/lightstatusproperty.cpp b/lib/lightstatusproperty.cpp
deleted file mode 100644 (file)
index ec55f3a..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-
-#include "lightstatusproperty.h"
-#include "runningstatusinterface.h"
-#include "debugout.h"
-
-void LightStatusProperty::setValue(LightStatusProperty::LightStatus val)
-{
-       AbstractProperty::setValue<LightStatusProperty::LightStatus>(val);
-}
-
-LightStatusProperty::LightStatus LightStatusProperty::value()
-{
-       return AbstractProperty::value<LightStatusProperty::LightStatus>();
-}
-
-
-void LightStatusProperty::fromGVariant(GVariant* value)
-{
-
-}
-
-GVariant* LightStatusProperty::toGVariant()
-{
-       GVariantBuilder builder;
-       
-       g_variant_builder_init(&builder, G_VARIANT_TYPE(signature().c_str()));
-       
-       LightStatusProperty::LightStatus lights = value();
-               
-       for(LightStatus::const_iterator itr = lights.begin(); itr != lights.end(); itr++)
-       {
-               g_variant_builder_add(&builder, "{yb}", (char)(*itr).first, (*itr).second);
-       }
-       
-       GVariant *variant = g_variant_new(signature().c_str(), &builder);
-       g_variant_builder_unref(&builder);
-       
-       return variant;
-}
-
-LightStatusProperty::LightStatusProperty()
-: AbstractProperty("LightStatus","a{yb}", AbstractProperty::Read, RunningStatusInterface::iface())
-{
-       setValue(LightStatus());
-}
-
diff --git a/lib/lightstatusproperty.h b/lib/lightstatusproperty.h
deleted file mode 100644 (file)
index 24f5974..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-
-#ifndef LIGHTSTATUSPROPERTY_H
-#define LIGHTSTATUSPROPERTY_H
-
-#include <abstractproperty.h>
-#include <map>
-
-class LightStatusProperty : public AbstractProperty
-{
-
-public:
-       enum Light {
-               Head = 0,
-               RightTurn = 1,
-               LeftTurn = 2,
-               Brake = 3,
-               Fog = 4,
-               Hazard = 5,
-               Parking = 6,
-               HighBeam = 7
-       };
-       
-       typedef std::map<Light, bool> LightStatus;
-       
-       operator LightStatus()
-       {
-               return value();
-       }
-
-       LightStatusProperty& operator = (LightStatus l)
-       {
-               setValue(l);
-               return *this;
-       }
-
-       void setValue(LightStatusProperty::LightStatus val);
-       LightStatusProperty::LightStatus value();
-       
-       virtual void fromGVariant(GVariant* value);
-       virtual GVariant* toGVariant();
-       LightStatusProperty();
-};
-
-#endif // LIGHTSTATUSPROPERTY_H
diff --git a/lib/runningstatusinterface.cpp b/lib/runningstatusinterface.cpp
deleted file mode 100644 (file)
index a78a315..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-Copyright (C) 2012 Intel Corporation
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library 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
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include "runningstatusinterface.h"
-#include <iostream>
-
-#include "debugout.h"
-#include "abstractproperty.h"
-
-using namespace std;
-
-RunningStatusInterface* RunningStatusInterface::mIface = nullptr;
-
-RunningStatusInterface* RunningStatusInterface::iface()
-{
-       if(mIface == nullptr)
-               mIface = new RunningStatusInterface();
-       
-       return mIface;
-}
-
-
-RunningStatusInterface::RunningStatusInterface()
-       : AbstractDBusInterface(DBusServiceName".RunningStatus", "/runningStatus")
-{
-       
-}
-
-
-GVariant* RunningStatusInterface::getProperty(std::string propertyName)
-{
-       if(properties.count(propertyName))
-               return properties[propertyName]->toGVariant();
-       else
-               throw -1;
-}
-
-void RunningStatusInterface::setProperty(std::string propertyName, GVariant* value)
-{
-       if(properties.count(propertyName))
-       {
-               properties[propertyName]->fromGVariant(value);
-       }
-       else
-       {
-               throw -1;
-       }
-}
-
-
diff --git a/lib/runningstatusinterface.h b/lib/runningstatusinterface.h
deleted file mode 100644 (file)
index 6726840..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-Copyright (C) 2012 Intel Corporation
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library 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
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#ifndef RUNNINGSTATUSINTERFACE_H
-#define RUNNINGSTATUSINTERFACE_H
-
-#include "abstractdbusinterface.h"
-
-
-class RunningStatusInterface : public AbstractDBusInterface
-{
-public:
-       static RunningStatusInterface* iface();
-
-protected:
-       RunningStatusInterface();
-       
-       virtual GVariant* getProperty(std::string propertyName);
-       virtual void setProperty(std::string propertyName, GVariant* value);
-       
-       static RunningStatusInterface* mIface;
-};
-
-
-
-#endif // RUNNINGSTATUSINTERFACE_H
diff --git a/lib/steeringwheelangleproperty.cpp b/lib/steeringwheelangleproperty.cpp
deleted file mode 100644 (file)
index b454188..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-    <one line to give the library's name and an idea of what it does.>
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include "steeringwheelangleproperty.h"
-#include "runningstatusinterface.h"
-
-void SteeringWheelAngleProperty::fromGVariant(GVariant* value)
-{
-
-}
-
-GVariant* SteeringWheelAngleProperty::toGVariant()
-{
-       return g_variant_new_uint16(value<uint16_t>());
-}
-
-SteeringWheelAngleProperty::SteeringWheelAngleProperty()
-       :AbstractProperty("SteeringWheelAngle","q",AbstractProperty::Read, RunningStatusInterface::iface())
-{
-       setValue<uint16_t>(0);
-}
-
diff --git a/lib/steeringwheelangleproperty.h b/lib/steeringwheelangleproperty.h
deleted file mode 100644 (file)
index 8bf83a7..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-    <one line to give the library's name and an idea of what it does.>
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#ifndef STEERINGWHEELANGLEPROPERTY_H
-#define STEERINGWHEELANGLEPROPERTY_H
-
-#include <abstractproperty.h>
-
-
-class SteeringWheelAngleProperty : public AbstractProperty
-{
-
-public:
-       operator uint16_t()
-       {
-               return value<uint16_t>();
-       }
-
-       SteeringWheelAngleProperty & operator = (uint16_t const & v)
-       {
-               setValue<uint16_t>(v);
-               return *this;
-       }
-
-       virtual void fromGVariant(GVariant* value);
-       virtual GVariant* toGVariant();
-       SteeringWheelAngleProperty();
-};
-
-#endif // STEERINGWHEELANGLEPROPERTY_H
diff --git a/lib/transmissiongearstatus.cpp b/lib/transmissiongearstatus.cpp
deleted file mode 100644 (file)
index cd9a415..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-
-#include "transmissiongearstatus.h"
-#include "runningstatusinterface.h"
-
-void TransmissionGearStatusProperty::setValue(TransmissionGearStatusProperty::TransmissionGearStatus status)
-{
-       AbstractProperty::setValue<TransmissionGearStatusProperty::TransmissionGearStatus>(status);
-}
-
-
-TransmissionGearStatusProperty::TransmissionGearStatus TransmissionGearStatusProperty::value()
-{
-       return AbstractProperty::value<TransmissionGearStatusProperty::TransmissionGearStatus>();
-}
-
-
-void TransmissionGearStatusProperty::fromGVariant(GVariant* value)
-{
-       setValue((TransmissionGearStatusProperty::TransmissionGearStatus)g_variant_get_byte(value));
-}
-
-GVariant* TransmissionGearStatusProperty::toGVariant()
-{
-       return g_variant_new_byte( (gchar) value() );
-}
-
-TransmissionGearStatusProperty::TransmissionGearStatusProperty()
-: AbstractProperty("TransmissionGearStatus", "y", AbstractProperty::Read, RunningStatusInterface::iface())
-{
-       setValue(TransmissionGearStatus::Neutral);
-}
-
diff --git a/lib/transmissiongearstatus.h b/lib/transmissiongearstatus.h
deleted file mode 100644 (file)
index de84145..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-
-#ifndef TRANSMISSIONGEARSTATUS_H
-#define TRANSMISSIONGEARSTATUS_H
-
-#include <abstractproperty.h>
-
-
-class TransmissionGearStatusProperty : public AbstractProperty
-{
-
-public:
-       enum TransmissionGearStatus 
-       {
-               Neutral = 0,
-               First = 1,
-               Second = 2,
-               Third = 3,
-               Fourth = 4,
-               Fifth = 5,
-               Sixth,
-               Seventh,
-               Eighth, 
-               Nineth,
-               Tenth,
-               Drive = 64,
-               Reverse = 128,
-               Park = 255
-       };
-       
-       operator TransmissionGearStatus()
-       {
-               return value();
-       }
-
-       TransmissionGearStatusProperty& operator = (TransmissionGearStatus const & t)
-       {
-               setValue(t);
-               return *this;
-       }
-
-       void setValue(TransmissionGearStatus status);
-       TransmissionGearStatus value();
-
-       virtual void fromGVariant(GVariant* value);
-       virtual GVariant* toGVariant();
-       TransmissionGearStatusProperty();
-};
-
-#endif // TRANSMISSIONGEARSTATUS_H
diff --git a/lib/tripmeterproperty.cpp b/lib/tripmeterproperty.cpp
deleted file mode 100644 (file)
index 6f085ac..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-
-#include "tripmeterproperty.h"
-#include "runningstatusinterface.h"
-
-
-void TripMeterProperty::setValue(TripMeters trips)
-{
-       AbstractProperty::setValue<TripMeters>(trips);
-}
-
-TripMeters TripMeterProperty::value()
-{
-       return AbstractProperty::value<TripMeters>();
-}
-
-
-void TripMeterProperty::fromGVariant(GVariant* value)
-{
-       
-}
-
-GVariant* TripMeterProperty::toGVariant()
-{
-       
-       TripMeters list = AbstractProperty::value<TripMeters>();
-       
-       GVariant* variant;
-       
-       GVariantBuilder params;
-       g_variant_builder_init(&params, G_VARIANT_TYPE(signature().c_str()));
-       for(TripMeters::iterator itr = list.begin(); itr != list.end(); itr++)
-       {
-               g_variant_builder_add_value(&params, g_variant_new_uint32(*itr));
-       }
-       
-       variant = g_variant_new("au",&params);
-       g_variant_builder_unref(&params);
-       
-       return variant;
-}
-
-TripMeterProperty::TripMeterProperty()
-: AbstractProperty("TripMeter", "au", AbstractProperty::ReadWrite, RunningStatusInterface::iface())
-{
-       setValue(TripMeters());
-}
-
diff --git a/lib/tripmeterproperty.h b/lib/tripmeterproperty.h
deleted file mode 100644 (file)
index 3b841b6..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-
-#ifndef TRIPMETERPROPERTY_H
-#define TRIPMETERPROPERTY_H
-
-#include <abstractproperty.h>
-#include <list>
-
-
-typedef std::list<uint32_t> TripMeters;
-
-class TripMeterProperty : public AbstractProperty
-{
-
-public:
-       void setValue(TripMeters trips);
-       TripMeters value(); 
-       virtual void fromGVariant(GVariant* value);
-       virtual GVariant* toGVariant();
-       TripMeterProperty();
-
-       operator TripMeters()
-       {
-               return value();
-       }
-
-       TripMeterProperty& operator = (TripMeters const &t)
-       {
-               setValue(t);
-               return *this;
-       }
-       
-private:
-       TripMeters mValue;
-};
-
-#endif // TRIPMETERPROPERTY_H
diff --git a/lib/vehiclepowermodeproperty.cpp b/lib/vehiclepowermodeproperty.cpp
deleted file mode 100644 (file)
index 16b2d3a..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-
-#include "vehiclepowermodeproperty.h"
-#include "runningstatusinterface.h"
-
-#include <glib.h>
-
-void VehiclePowerModeProperty::setValue(VehiclePowerModeProperty::VehiclePowerMode mode)
-{
-       AbstractProperty::setValue<VehiclePowerModeProperty::VehiclePowerMode>(mode);
-}
-
-VehiclePowerModeProperty::VehiclePowerMode VehiclePowerModeProperty::value()
-{
-       return AbstractProperty::value<VehiclePowerModeProperty::VehiclePowerMode>();
-}
-
-
-void VehiclePowerModeProperty::fromGVariant(GVariant* value)
-{
-       setValue((VehiclePowerMode)g_variant_get_byte(value));
-}
-
-GVariant* VehiclePowerModeProperty::toGVariant()
-{
-       return g_variant_new_byte( (gchar) value() );
-}
-
-VehiclePowerModeProperty::VehiclePowerModeProperty()
-: AbstractProperty("VehiclePowerMode", "y", AbstractProperty::Read, RunningStatusInterface::iface())
-{
-       setValue(VehiclePowerModeProperty::Off);
-}
-
diff --git a/lib/vehiclepowermodeproperty.h b/lib/vehiclepowermodeproperty.h
deleted file mode 100644 (file)
index 5807a1e..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-
-#ifndef VEHICLEPOWERMODEPROPERTY_H
-#define VEHICLEPOWERMODEPROPERTY_H
-
-#include <abstractproperty.h>
-
-
-class VehiclePowerModeProperty : public AbstractProperty
-{
-
-public:
-       enum VehiclePowerMode
-       {
-               Off = 0,
-               Accessory1 = 1,
-               Accessory2 = 2,
-               Run = 3
-       };
-
-       operator VehiclePowerMode()
-       {
-               return value();
-       }
-
-       VehiclePowerModeProperty& operator = (VehiclePowerMode const & mode)
-       {
-               setValue(mode);
-               return *this;
-       }
-
-       void setValue(VehiclePowerMode mode);
-       VehiclePowerMode value();
-
-       virtual void fromGVariant(GVariant* value);
-       virtual GVariant* toGVariant();
-       VehiclePowerModeProperty();
-       
-private:
-       
-       VehiclePowerMode mMode;
-       
-};
-
-#endif // VEHICLEPOWERMODEPROPERTY_H
similarity index 63%
rename from lib/fuelrangeproperty.h
rename to lib/vehicleproperty.cpp
index bf455f4..e995aa9 100644 (file)
@@ -1,5 +1,4 @@
 /*
-    <one line to give the library's name and an idea of what it does.>
     Copyright (C) 2012  Intel Corporation
 
     This library is free software; you can redistribute it and/or
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
-#ifndef FUELRANGEPROPERTY_H
-#define FUELRANGEPROPERTY_H
 
-#include <abstractproperty.h>
+#include "vehicleproperty.h"
 
-
-class FuelRangeProperty : public AbstractProperty
+VehicleProperty::VehicleProperty()
 {
 
-public:
-       virtual void fromGVariant(GVariant* value);
-       virtual GVariant* toGVariant();
-       FuelRangeProperty();
-
-       FuelRangeProperty& operator=(uint16_t const & other);
+}
 
-       operator uint16_t()
-       {
-               return value<uint16_t>();
-       }
-};
+string VehicleProperty::name(VehicleProperty::Property prop)
+{
+       return "";
+}
 
-#endif // FUELRANGEPROPERTY_H
+VehicleProperty::Property VehicleProperty::value(string name)
+{
+       return VehicleProperty::NoValue;
+}
similarity index 65%
rename from lib/chime.h
rename to lib/vehicleproperty.h
index 8e24d7b..8eed19e 100644 (file)
@@ -1,5 +1,4 @@
 /*
-    <one line to give the library's name and an idea of what it does.>
     Copyright (C) 2012  Intel Corporation
 
     This library is free software; you can redistribute it and/or
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
-#ifndef CHIME_H
-#define CHIME_H
 
-#include <abstractproperty.h>
+#ifndef VEHICLEPROPERTY_H
+#define VEHICLEPROPERTY_H
 
-class Chime : public AbstractProperty
+#include <string>
+#include <list>
+
+using namespace std;
+
+class VehicleProperty
 {
 
 public:
-       void setValue(bool);
-       bool value();
 
-       operator bool()
-       {
-               return value();
-       }
+       VehicleProperty();
 
-       Chime& operator =  (bool const & val)
+       enum Property
        {
-               this->setValue(val);
-               return *this;
-       }
-
-       virtual void fromGVariant(GVariant* value);
-       virtual GVariant* toGVariant();
-       Chime();
+               NoValue=0,
+               VehicleSpeed,
+               EngineSpeed
+       };
+
+       static string name(Property prop);
+       static Property value(string name);
+    
 };
 
+typedef list<VehicleProperty::Property> PropertyList;
 
-
-#endif // CHIME_H
+#endif // VEHICLEPROPERTY_H
diff --git a/lib/vehiclespeed.cpp b/lib/vehiclespeed.cpp
deleted file mode 100644 (file)
index f0bc499..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-Copyright (C) 2012 Intel Corporation
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library 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
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include "vehiclespeed.h"
-#include "runningstatusinterface.h"
-#include "debugout.h"
-
-#include <glib.h>
-
-VehicleSpeedProperty::VehicleSpeedProperty(): AbstractProperty("VehicleSpeed", "q", AbstractProperty::Read, RunningStatusInterface::iface())
-{
-       setValue(0);
-}
-
-void VehicleSpeedProperty::setValue(uint16_t val)
-{
-       AbstractProperty::setValue<uint16_t>(val);
-}
-
-uint16_t VehicleSpeedProperty::value()
-{
-       return AbstractProperty::value<uint16_t>();
-}
-
-GVariant* VehicleSpeedProperty::toGVariant()
-{
-
-       return g_variant_new_uint16(value());
-}
-
-void VehicleSpeedProperty::fromGVariant(GVariant *value)
-{
-       setValue((uint16_t)g_variant_get_uint16(value));
-}
diff --git a/lib/vehiclespeed.h b/lib/vehiclespeed.h
deleted file mode 100644 (file)
index 5c4bf95..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-Copyright (C) 2012 Intel Corporation
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library 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
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#ifndef VEHICLESPEED_H
-#define VEHICLESPEED_H
-
-#include "abstractproperty.h"
-
-class VehicleSpeedProperty : public AbstractProperty
-{
-
-public:
-       VehicleSpeedProperty();
-       void setValue(uint16_t val);
-       uint16_t value();
-       
-       operator uint16_t()
-       {
-               return value();
-       }
-
-       VehicleSpeedProperty& operator = (uint16_t const &v)
-       {
-               setValue(v);
-               return *this;
-       }
-
-       GVariant* toGVariant();
-       void fromGVariant(GVariant *value);
-       
-
-};
-
-#endif // VEHICLESPEED_H
diff --git a/lib/wheelbrakeproperty.cpp b/lib/wheelbrakeproperty.cpp
deleted file mode 100644 (file)
index 2a366de..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-
-#include "wheelbrakeproperty.h"
-#include "runningstatusinterface.h"
-
-void WheelBrakeProperty::setValue(bool val)
-{
-       AbstractProperty::setValue<bool>(val);
-}
-
-bool WheelBrakeProperty::value()
-{
-       return AbstractProperty::value<bool>();
-}
-
-void WheelBrakeProperty::fromGVariant(GVariant* value)
-{
-
-}
-
-GVariant* WheelBrakeProperty::toGVariant()
-{
-       return g_variant_new_boolean(value());
-}
-
-WheelBrakeProperty::WheelBrakeProperty()
-: AbstractProperty("WheelBrake","b",AbstractProperty::Read,RunningStatusInterface::iface())
-{
-       setValue(false);
-}
-
diff --git a/lib/wheelbrakeproperty.h b/lib/wheelbrakeproperty.h
deleted file mode 100644 (file)
index 48f21a6..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-    Copyright (C) 2012  Intel Corporation
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-
-#ifndef WHEELBRAKEPROPERTY_H
-#define WHEELBRAKEPROPERTY_H
-
-#include <abstractproperty.h>
-
-
-class WheelBrakeProperty : public AbstractProperty
-{
-
-public:
-       operator bool()
-       {
-               return value();
-       }
-
-       WheelBrakeProperty & operator = (bool const & v)
-       {
-               setValue(v);
-               return *this;
-       }
-
-    virtual void fromGVariant(GVariant* value);
-    virtual GVariant* toGVariant();
-    
-    void setValue(bool val);
-    bool value();
-    
-    WheelBrakeProperty();
-};
-
-#endif // WHEELBRAKEPROPERTY_H
index dcccec0..c80e8a3 100644 (file)
@@ -23,144 +23,44 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
 using namespace std;
 
-#include "enginespeedproperty.h"
-#include "vehiclepowermodeproperty.h"
-#include "fueleconomyproperty.h"
-#include "tripmeterproperty.h"
-#include "transmissiongearstatus.h"
-#include "cruisecontrolstatus.h"
-#include "wheelbrakeproperty.h"
-#include "lightstatusproperty.h"
-#include "interiorlightstatusproperty.h"
-#include "hornproperty.h"
-#include "chime.h"
-#include "fuellevelproperty.h"
-#include "fuelrangeproperty.h"
-#include "engineoilproperty.h"
-#include "enginecoolantproperty.h"
-#include "accelerationproperty.h"
-#include "steeringwheelangleproperty.h"
-
 #include "debugout.h"
 
-ExamplePlugin::ExamplePlugin()
+ExampleSourcePlugin::ExampleSourcePlugin()
 {
-       int velocity = 5;
-       
-       VehicleSpeedProperty* speed = new VehicleSpeedProperty();
-       *speed = velocity;
-       
-       EngineSpeedProperty* engineSpeed = new EngineSpeedProperty();
-       engineSpeed->setValue(2000);
-       
-       VehiclePowerModeProperty* vehiclePowerMode = new VehiclePowerModeProperty();
-       *vehiclePowerMode = VehiclePowerModeProperty::Run;
-       
-       FuelEconomyProperty* fueleconomyproperty = new FuelEconomyProperty();
-       *fueleconomyproperty = 42;
-       
-       TripMeters trips;
-       trips.push_back(1500);
-       trips.push_back(1000);
-       
-       TripMeterProperty* tripmeterproperty = new TripMeterProperty();
-       *tripmeterproperty = trips;
-       
-       TransmissionGearStatusProperty* transmissiongearstatus = new TransmissionGearStatusProperty();
-       transmissiongearstatus->setValue(TransmissionGearStatusProperty::First);
-       
-       CruiseControlStatus cruisecontrolstatus = CruiseControlStatus(true, velocity);
-
-       CruiseControlStatusProperty * cruisecontrolstatusproperty = new CruiseControlStatusProperty();
-       *cruisecontrolstatusproperty = cruisecontrolstatus;
-       
-       WheelBrakeProperty *wheelbrakeproperty = new WheelBrakeProperty();
-       *wheelbrakeproperty = false;
        
-       LightStatusProperty::LightStatus lights;
-       lights[LightStatusProperty::Brake] = wheelbrakeproperty->value();
-       lights[LightStatusProperty::Fog] = true;
-       lights[LightStatusProperty::Head] = true;
-       lights[LightStatusProperty::HighBeam] = false;
-       lights[LightStatusProperty::Hazard] = false;
-       lights[LightStatusProperty::LeftTurn] = false;
-       lights[LightStatusProperty::RightTurn] = false;
-       lights[LightStatusProperty::Parking] = false;
-       
-       LightStatusProperty *lightstatusproperty = new LightStatusProperty();
-       *lightstatusproperty = lights;
-       
-       InteriorLightStatusProperty::InteriorLightStatus interiorLights;
-       interiorLights[InteriorLightStatusProperty::Driver] = false;
-       interiorLights[InteriorLightStatusProperty::Passenger] = true;
-       interiorLights[InteriorLightStatusProperty::Center] = false;
-       
-       InteriorLightStatusProperty* interiorlightstatusproperty = new InteriorLightStatusProperty();
-       *interiorlightstatusproperty = interiorLights;
-
-       HornProperty *hornProperty = new HornProperty();
-       *hornProperty = false;
-
-       Chime * chime = new Chime();
-       *chime = false;
-
-       bool val = *chime;
-
-       BOOST_ASSERT(val == false);
-
-       FuelLevelProperty *fuelLevel = new FuelLevelProperty();
-       *fuelLevel = (uint8_t)95;
-
-       uint8_t fl = *fuelLevel;
-
-       BOOST_ASSERT(fl == 95);
-
-       FuelRangeProperty* fuelRange = new FuelRangeProperty();
-
-       *fuelRange = 321;
-
-       uint16_t fr = *fuelRange;
-
-       BOOST_ASSERT(fr == 321);
-
-       EngineOilProperty *oilproperty = new EngineOilProperty();
-
-       EngineOil oil;
-       oil.temperature = 32;
-       oil.pressure = 400;
-       oil.remaining = 88;
-
-       *oilproperty = oil;
-
-       EngineOil ol = *oilproperty;
-
-       BOOST_ASSERT(ol == oil);
-
-       EngineCoolant coolant;
-       coolant.level= 99;
-       coolant.temperature = 44;
-
-       EngineCoolantProperty *coolantProp = new EngineCoolantProperty();
-       *coolantProp = coolant;
+}
 
-       EngineCoolant ec = *coolantProp;
+extern "C" AbstractSource * create()
+{
+       return new ExampleSourcePlugin();
+}
 
-       BOOST_ASSERT(ec == coolant);
+string ExampleSourcePlugin::name()
+{
+       return "example source plugin";
+}
 
-       AccelerationProperty* accelerationProp = new AccelerationProperty();
-       Acceleration accel;
-       accel.x = 1;
-       accel.y = 0.25;
-       accel.z = 0;
+void ExampleSourcePlugin::setProperty(VehicleProperty::Property , boost::any )
+{
 
-       *accelerationProp = accel;
+}
 
-       SteeringWheelAngleProperty * steeringWheelAngle = new SteeringWheelAngleProperty();
+void ExampleSourcePlugin::subscribeToPropertyChanges(VehicleProperty::Property property)
+{
+       mRequests.push_back(property);
+}
 
-       *steeringWheelAngle = 100;
+PropertyList ExampleSourcePlugin::supported()
+{
+       PropertyList props;
+       props.push_back(VehicleProperty::EngineSpeed);
+       props.push_back(VehicleProperty::VehicleSpeed);
+       
+       return props;
 }
 
-extern "C" void create()
+void ExampleSourcePlugin::unsubscribeToPropertyChanges(VehicleProperty::Property property)
 {
-       new ExamplePlugin;
+       mRequests.remove(property);
 }
+
index a18cfb0..c267820 100644 (file)
@@ -19,13 +19,24 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 #ifndef EXAMPLEPLUGIN_H
 #define EXAMPLEPLUGIN_H
 
-#include "vehiclespeed.h"
+#include <abstractsource.h>
+#include <string>
 
-class ExamplePlugin 
+using namespace std;
+
+class ExampleSourcePlugin: public AbstractSource
 {
 
 public:
-       ExamplePlugin();
+       ExampleSourcePlugin();
+       string name();
+       void setProperty(VehicleProperty::Property, boost::any);
+       void subscribeToPropertyChanges(VehicleProperty::Property property);
+       void unsubscribeToPropertyChanges(VehicleProperty::Property property);
+       PropertyList supported();
+       
+private:
+       PropertyList mRequests;
 };
 
 #endif // EXAMPLEPLUGIN_H