missing this
authorKevron Rees <kevron_m_rees@linux.intel.com>
Thu, 16 Aug 2012 23:20:22 +0000 (16:20 -0700)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Thu, 16 Aug 2012 23:20:22 +0000 (16:20 -0700)
plugins/examplesink.cpp [new file with mode: 0644]
plugins/examplesink.h [new file with mode: 0644]

diff --git a/plugins/examplesink.cpp b/plugins/examplesink.cpp
new file mode 100644 (file)
index 0000000..589ab9a
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+    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 "examplesink.h"
+#include "abstractroutingengine.h"
+#include "debugout.h"
+
+extern "C" AbstractSinkManager * create(AbstractRoutingEngine* routingengine)
+{
+       return new ExampleSinkManager(routingengine);
+}
+
+ExampleSink::ExampleSink(AbstractRoutingEngine* engine): AbstractSink(engine)
+{
+       routingEngine->subscribeToProperty(VehicleProperty::EngineSpeed, this);
+       routingEngine->subscribeToProperty(VehicleProperty::VehicleSpeed, this);
+}
+
+
+PropertyList ExampleSink::subscriptions()
+{
+
+}
+
+void ExampleSink::supportedChanged(PropertyList supportedProperties)
+{
+
+}
+
+void ExampleSink::propertyChanged(VehicleProperty::Property property, boost::any value, std::string uuid)
+{
+       DebugOut()<<VehicleProperty::name(property)<<" value: "<<boost::any_cast<uint16_t>(value)<<endl;
+}
+
+std::string ExampleSink::uuid()
+{
+       return "f7e4fab2-eb73-4842-9fb0-e1c550eb2d81";
+}
diff --git a/plugins/examplesink.h b/plugins/examplesink.h
new file mode 100644 (file)
index 0000000..663c539
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+    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 EXAMPLESINK_H
+#define EXAMPLESINK_H
+
+#include <../../home/tripzero/src/automotive-message-broker/lib/abstractsink.h>
+
+
+class ExampleSink : public AbstractSink
+{
+
+public:
+       ExampleSink(AbstractRoutingEngine* engine);
+       virtual PropertyList subscriptions();
+       virtual void supportedChanged(PropertyList supportedProperties);
+       virtual void propertyChanged(VehicleProperty::Property property, boost::any value, std::string uuid);
+       virtual std::string uuid();
+};
+
+class ExampleSinkManager: public AbstractSinkManager
+{
+public:
+       ExampleSinkManager(AbstractRoutingEngine* engine)
+       :AbstractSinkManager(engine)
+       {
+               new ExampleSink(engine);
+       }
+};
+
+#endif // EXAMPLESINK_H