From 2cd643094b570c080e3bd56e6b730d0365d23e45 Mon Sep 17 00:00:00 2001 From: Kevron Rees Date: Thu, 16 Aug 2012 16:20:22 -0700 Subject: [PATCH] missing this --- plugins/examplesink.cpp | 54 +++++++++++++++++++++++++++++++++++++++++++++++++ plugins/examplesink.h | 47 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 plugins/examplesink.cpp create mode 100644 plugins/examplesink.h diff --git a/plugins/examplesink.cpp b/plugins/examplesink.cpp new file mode 100644 index 0000000..589ab9a --- /dev/null +++ b/plugins/examplesink.cpp @@ -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()<(value)< + + +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 -- 2.7.4