Merge pull request #67 from tripzero/trip
[profile/ivi/automotive-message-broker.git] / lib / ambpluginimpl.h
index d9482f0..9bd3c2d 100644 (file)
@@ -21,15 +21,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
 #include "abstractsource.h"
 
-/*! \addtogroup ivipocbase
+/*! \addtogroup libamb
  *  @{
  */
 
 /*!
  * \brief AmbPlugin private class implementation - base class for all plugin implementations.
  *
- * Contains common code used in all IviPoC II plugins for Automotive message broker(AMB).
- * For the AMB library API please visit <a href="https://github.com/otcshare/automotive-message-broker">Automotive message broker web page</a>.
+ * Contains common code used in plugins for Automotive message broker(AMB).
+ * For the AMB library API please visit \ref libamb.
  *
  * \class AmbPluginImpl
  */
@@ -131,6 +131,22 @@ public:
         */
        virtual void init();
 
+       /*!
+        * \brief setValue of a property
+        */
+       template <typename T>
+       void setValue(std::shared_ptr<AbstractPropertyType> property, T value)
+       {
+               if(property->value<T>() == value)
+               {
+                       return;
+               }
+
+               property->setValue(value);
+               routingEngine->updateProperty(property.get(), source.uuid());
+       }
+
+
 protected:
 
        /*! Finds property type in #properties
@@ -145,7 +161,7 @@ protected:
         * \param typeFactory Function to be used to create instance of the AbstractPropertyType for registered property
         * \return AbstractPropertyType* if signal exits otherwise nullptr(in this case we do not know its datatype)
         */
-       std::shared_ptr<AbstractPropertyType> addPropertySupport(Zone::Type zone, std::function<AbstractPropertyType* (void)> typeFactory);
+       std::shared_ptr<AbstractPropertyType> addPropertySupport(Zone::Type zone, std::function<AbstractPropertyType* (void)> typeFactory, std::string sourceUuid="");
 
        template <class T>
        std::shared_ptr<AbstractPropertyType> addPropertySupport(Zone::Type zone)