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
22 #include "abstractsink.h"
23 #include "abstractproperty.h"
24 #include "abstractdbusinterface.h"
25 #include "varianttype.h"
28 #include <type_traits>
30 typedef std::vector<VariantType*> PropertyDBusMap;
31 //typedef std::unordered_map<VehicleProperty::Property, VariantType*> PropertyDBusMap;
33 class DBusSink : public AbstractSink, public AbstractDBusInterface
37 DBusSink(std::string objectName, AbstractRoutingEngine* engine, GDBusConnection* connection, map<string, string> config);
40 for(auto i : propertyDBusMap)
45 virtual void supportedChanged(const PropertyList & supportedProperties);
46 virtual void propertyChanged(AbstractPropertyType *value);
47 virtual const std::string uuid();
49 static std::map<std::string, std::string> dbusConfig;
51 PropertyList wantsProperties()
54 for(auto i : propertyDBusMap)
56 l.push_back(i->ambPropertyName());
62 void setSourceFilter(std::string sourceFilter)
64 mSourceFilter = sourceFilter;
67 void setZoneFilter(Zone::Type zone)
74 void wantProperty(VehicleProperty::Property property, std::string propertyName, std::string signature, AbstractProperty::Access access)
76 //propertyDBusMap[property] = new VariantType(routingEngine, signature, property, propertyName, access);
77 propertyDBusMap.push_back( new VariantType(routingEngine, signature, property, propertyName, access));
81 void wantPropertyString(VehicleProperty::Property property, std::string propertyName, std::string signature, AbstractProperty::Access access)
83 //propertyDBusMap[property] = new VariantType(routingEngine, signature, property, propertyName, access);
84 propertyDBusMap.push_back( new VariantType(routingEngine, signature, property, propertyName, access));
87 void wantPropertyVariant(VehicleProperty::Property ambProperty, std::string propertyName, std::string signature, AbstractProperty::Access access)
89 //propertyDBusMap[ambProperty] = new VariantType(routingEngine, signature, ambProperty, propertyName, access);
90 propertyDBusMap.push_back(new VariantType(routingEngine, signature, ambProperty, propertyName, access));
93 PropertyDBusMap propertyDBusMap;
99 class DBusInterfaceManager;
100 class DBusSinkManager: public AbstractSinkManager
102 DBusInterfaceManager* manager;
104 DBusSinkManager(AbstractRoutingEngine* engine, map<string, string> config);