automotive-message-broker  0.13.1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
/home/abuild/rpmbuild/BUILD/automotive-message-broker-0.13/lib/vehicleproperty.h

registerProperty registers properties with the Vehicle Property system. Returns true if property has been registered successfully.

Parameters
name- name of property. Name cannot match any existing property or it will be rejected and this method will return false.
factor- callback function that returns an AbstractPropertyType representation of the value. custom properties will need to return a custom AbstractPropertyType based object.

#include <vehicleproperty.h> #include <abstractpropertytype.h>

//Somewhere in a source plugin: ... Property VehicleJetEngineStatus = "VehicleJetEngineStatus"; VehicleProperty::registerProperty(VehicleJetEngineStatus, [](){return new BasicPropertyType<bool>(VehicleJetEngineStatus, false);}); ... //other initialization