propertiesPerSecond++;
+ /*if(previousValueMap.find(property) != previousValueMap.end())
+ {
+ std::string v = previousValueMap[property];
+ if(v == value->toString())
+ {
+ ///no change from last value;
+ return;
+ }
+ }
+
+ previousValueMap[property] = value->toString();*/
+
for(SinkList::iterator itr = list.begin(); itr != list.end(); itr++)
{
(*itr)->propertyChanged(property, value, uuid, timestamp, sequence);
int propertiesPerSecond;
std::map<VehicleProperty::Property, SinkList> propertySinkMap;
+
+ std::map<VehicleProperty::Property, std::string> previousValueMap;
};
class AbstractPropertyType
{
public:
- virtual std::string toString() = 0;
+ virtual std::string toString() const = 0;
virtual void fromString(std::string)= 0;
+ virtual AbstractPropertyType* copy() = 0;
+
void setValue(boost::any val)
{
mValue = val;
else throw std::runtime_error("value cannot be empty");
}
+ AbstractPropertyType* copy()
+ {
+ return new BasicPropertyType<T>(*this);
+ }
+
void fromString(std::string val)
{
if(!val.empty() && val != "")
}
}
- std::string toString()
+ std::string toString() const
{
std::stringstream stream;
stream<<value<T>();
setValue(val);
}
+ AbstractPropertyType* copy()
+ {
+ return new StringPropertyType(*this);
+ }
- std::string toString()
+ std::string toString() const
{
return value<std::string>();
}