}
}
- return PropertyInfo();
+ return PropertyInfo::invalid();
}
std::list<string> Core::getSourcesForProperty(VehicleProperty::Property property)
PropertyInfo AbstractSource::getPropertyInfo(VehicleProperty::Property property)
{
- return PropertyInfo();
+ return PropertyInfo::invalid();
}
class PropertyInfo
{
public:
+
/** PropertyInfo
- *
- **/
- PropertyInfo(): mUpdateFrequency(0) {}
+ * @arg updateFrequency
+ * @arg zonesList
+ */
+ PropertyInfo(uint updateFreq, std::list<Zone::Type> zonesList)
+ :mUpdateFrequency(updateFreq), mZones(zonesList), mIsValid(true)
+ {
+
+ }
/** updateFrequency
return mZones;
}
+ /** isValid
+ * returns whether this PropertyInfo is valid
+ *
+ * default when you construct a PropertyInfo is false
+ **/
+ bool isValid()
+ {
+ return mIsValid;
+ }
+
+
+ /** invalid()
+ * returns instance of PropertyInfo that isn't valid
+ **/
+ static PropertyInfo invalid()
+ {
+ return PropertyInfo();
+ }
+
+protected:
+ /** PropertyInfo
+ *
+ **/
+ PropertyInfo(): mUpdateFrequency(0), mIsValid(false) {}
+
private:
uint mUpdateFrequency;
std::list<Zone::Type> mZones;
+ bool mIsValid;
};
PropertyInfo DatabaseSink::getPropertyInfo(VehicleProperty::Property property)
{
/// TODO: Compute update frequency for properties in the database
- return PropertyInfo();
+ return PropertyInfo::invalid();
}
void DatabaseSink::parseConfig()
void randomizeProperties();
- PropertyInfo getPropertyInfo(VehicleProperty::Property ) { return PropertyInfo(); }
+ PropertyInfo getPropertyInfo(VehicleProperty::Property ) {
+ /// TODO FIXME don't just return an invalid property info
+ return PropertyInfo::invalid();
+ }
private:
PropertyList mRequests;