2 Copyright (C) 2012 Intel Corporation
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with this library; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 #include "examplesink.h"
21 #include "abstractroutingengine.h"
24 extern "C" AbstractSinkManager * create(AbstractRoutingEngine* routingengine)
26 return new ExampleSinkManager(routingengine);
29 ExampleSink::ExampleSink(AbstractRoutingEngine* engine): AbstractSink(engine)
31 routingEngine->subscribeToProperty(VehicleProperty::EngineSpeed, this);
32 routingEngine->subscribeToProperty(VehicleProperty::VehicleSpeed, this);
34 AsyncPropertyRequest velocityRequest;
35 velocityRequest.property = VehicleProperty::VehicleSpeed;
36 velocityRequest.completed = [](AsyncPropertyReply* reply) { DebugOut()<<"Velocity Async request completed: "<<boost::any_cast<uint16_t>(reply->value)<<endl; };
38 AsyncPropertyReply* reply = routingEngine->getPropertyAsync(velocityRequest);
42 PropertyList ExampleSink::subscriptions()
47 void ExampleSink::supportedChanged(PropertyList supportedProperties)
52 void ExampleSink::propertyChanged(VehicleProperty::Property property, boost::any value, std::string uuid)
54 DebugOut()<<VehicleProperty::name(property)<<" value: "<<boost::any_cast<uint16_t>(value)<<endl;
57 std::string ExampleSink::uuid()
59 return "f7e4fab2-eb73-4842-9fb0-e1c550eb2d81";