#define _BASICPROPERTY_H_
#include "abstractproperty.h"
+#include "vehicleproperty.h"
+#include "abstractroutingengine.h"
template <typename T>
class BasicProperty: public AbstractProperty
{
public:
- BasicProperty(string propertyName, string signature, Access access, AbstractDBusInterface *interface)
- :AbstractProperty(propertyName,signature,access,interface)
+ BasicProperty(AbstractRoutingEngine* re, string ambPropertyName, string propertyName, string signature, Access access, AbstractDBusInterface *interface)
+ :AbstractProperty(propertyName, signature, access, interface)
{
-
+ mAmbPropertyName = ambPropertyName;
}
void setValue(T val)
virtual void fromGVariant(GVariant *value)
{
+ T val;
+ g_variant_get(value,signature().c_str(), &val);
+
+ AbstractPropertyType* apt = VehicleProperty::getPropertyTypeForPropertyNameValue(mAmbPropertyName,"");
+ apt->setValue(val);
+ routingEngine->setProperty(mAmbPropertyName, apt);
+
+ ///delete this because we should be done
+ delete apt;
}
+
+private:
+ VehicleProperty::Property mAmbPropertyName;
+ AbstractRoutingEngine* routingEngine;
};
#endif