subscribeToProperty(property,sink);
}
+void Core::subscribeToProperty(VehicleProperty::Property, string sourceUuidFilter, Zone::Type zoneFilter, AbstractSink *self)
+{
+
+}
+
void Core::unsubscribeToProperty(VehicleProperty::Property property, AbstractSink* self)
{
if(propertySinkMap.find(property) == propertySinkMap.end())
AsyncPropertyReply * setProperty(AsyncSetPropertyRequest request);
void subscribeToProperty(VehicleProperty::Property, AbstractSink* self);
void subscribeToProperty(VehicleProperty::Property, std::string sourceUuidFilter, AbstractSink *self);
+ void subscribeToProperty(VehicleProperty::Property, std::string sourceUuidFilter, Zone::Type zoneFilter, AbstractSink *self);
void unsubscribeToProperty(VehicleProperty::Property, AbstractSink* self);
PropertyList supported() { return mMasterPropertyList; }
virtual AsyncPropertyReply * setProperty(AsyncSetPropertyRequest request) = 0;
virtual void subscribeToProperty(VehicleProperty::Property, AbstractSink* self) = 0;
virtual void subscribeToProperty(VehicleProperty::Property, std::string sourceUuidFilter, AbstractSink *self) = 0;
+ virtual void subscribeToProperty(VehicleProperty::Property, std::string sourceUuidFilter, Zone::Type zoneFilter, AbstractSink *self) = 0;
virtual void unsubscribeToProperty(VehicleProperty::Property, AbstractSink* self) = 0;
virtual PropertyInfo getPropertyInfo(VehicleProperty::Property, std::string sourceUuid) = 0;
QObject *BluemonkeySink::subscribeTo(QString str)
{
- return new Property(str.toStdString(), routingEngine, this);
+ return new Property(str.toStdString(), "", routingEngine, this);
}
+QObject *BluemonkeySink::subscribeTo(QString str, QString srcFilter)
+{
+ return new Property(str.toStdString(), srcFilter, routingEngine, this);
+}
+
+QStringList BluemonkeySink::sourcesForProperty(QString property)
+{
+ std::list<std::string> list = routingEngine->sourcesForProperty(property.toStdString());
+ QStringList strList;
+ for(auto itr = list.begin(); itr != list.end(); itr++)
+ {
+ strList<<(*itr).c_str();
+ }
+
+ return strList;
+}
+
+
bool BluemonkeySink::authenticate(QString pass)
{
routingEngine->setProperty(request);
}
-Property::Property(VehicleProperty::Property prop, AbstractRoutingEngine* re, QObject *parent)
+Property::Property(VehicleProperty::Property prop, QString srcFilter, AbstractRoutingEngine* re, QObject *parent)
:QObject(parent), AbstractSink(re, std::map<std::string,std::string>()),mValue(nullptr)
{
setType(prop.c_str());
void Property::propertyChanged(VehicleProperty::Property property, AbstractPropertyType *value, string uuid)
{
+ if(mValue)
+ {
+ delete mValue;
+ }
mValue = value->copy();
changed(gvariantToQVariant(mValue->toVariant()));
Q_PROPERTY(QVariant value READ value WRITE setValue)
public:
- Property(VehicleProperty::Property, AbstractRoutingEngine* re, QObject *parent = 0);
+ Property(VehicleProperty::Property, QString srcFilter, AbstractRoutingEngine* re, QObject *parent = 0);
QString type();
void setType(QString t);
- virtual PropertyList subscriptions() { PropertyList list; list.push_back(type().toStdString()); return list; }
+ virtual PropertyList subscriptions() { return PropertyList(); }
virtual void supportedChanged(PropertyList ){ }
virtual void propertyChanged(VehicleProperty::Property property, AbstractPropertyType* value, std::string uuid);
public Q_SLOTS:
QObject* subscribeTo(QString str);
+ QObject* subscribeTo(QString str, QString srcFilter);
+
+ QStringList sourcesForProperty(QString property);
bool authenticate(QString pass);
{
propertyReplyMap[property]->value = value;
propertyReplyMap[property]->success = true;
- propertyReplyMap[property]->completed(propertyReplyMap[property]);
+ try {
+ propertyReplyMap[property]->completed(propertyReplyMap[property]);
+ }catch(...)
+ {
+ DebugOut(DebugOut::Error)<<"failed to call reply completed callback"<<endl;
+ }
+
propertyReplyMap.erase(property);
}
else