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 #ifndef ABSTRACTSINK_H
21 #define ABSTRACTSINK_H
27 #include <boost/any.hpp>
29 #include "vehicleproperty.h"
30 #include "abstractpropertytype.h"
34 class AbstractRoutingEngine;
37 typedef list<AbstractSink*> SinkList;
43 AbstractSink(AbstractRoutingEngine* engine, map<string, string> config);
44 virtual ~AbstractSink();
46 ///Pure virtual methods:
48 /*! uuid() is a unique identifier
49 * @return a guid-style unique identifier
51 virtual string uuid() = 0;
53 /*! propertyChanged is called when a subscribed to property changes.
54 * @see AbstractRoutingEngine::subscribeToPropertyChanges()
55 * @param property name that changed
56 * @param value value of the property that changed. this is a temporary pointer that will be destroyed.
57 * Do not destroy it. If you need to store the value use value.anyValue() or value.value<T>() to copy.
58 * @param uuid Unique identifier representing the source
60 virtual void propertyChanged(VehicleProperty::Property property, AbstractPropertyType* value, string uuid, double timestamp, uint32_t sequence) = 0;
61 virtual void supportedChanged(PropertyList supportedProperties) = 0;
64 virtual void setConfiguration(map<string, string> config);
67 AbstractRoutingEngine* routingEngine;
68 map<string, string> configuration;
71 class AbstractSinkManager
75 AbstractSinkManager(AbstractRoutingEngine* engine, map<string, string> config);
78 AbstractRoutingEngine* routingEngine;
79 map<string, string> configuration;
82 #endif // ABSTRACTSINK_H