automotive-message-broker  0.14.803
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
AmbPluginImpl Class Referenceabstract

AmbPlugin private class implementation - base class for all plugin implementations. More...

#include <ambpluginimpl.h>

Inheritance diagram for AmbPluginImpl:
BluemonkeySink CANGenPlugin CANSimPlugin ChronySink DatabaseSink DBusInterfaceManager GpsNmeaSource OpenCvLuxPlugin

Public Member Functions

 AmbPluginImpl (AbstractRoutingEngine *re, const map< string, string > &config, AbstractSource &parent)
 
virtual void getPropertyAsync (AsyncPropertyReply *reply)
 getPropertyAsync is called when a sink requests the value for given property. This is only called if the source supports the Get operation.
 
virtual void getRangePropertyAsync (AsyncRangePropertyReply *reply)
 getRangePropertyAsync is called when a sink requests a series of values for a given property within a specified time or sequencial range. This will only be called if the source support the Ranged Operation.
 
virtual AsyncPropertyReplysetProperty (const AsyncSetPropertyRequest &request)
 setProperty is called when a sink requests to set a value for a given property. This is only called if the source supports the Set Operation.
 
virtual void subscribeToPropertyChanges (const VehicleProperty::Property &property)
 subscribeToPropertyChanges is called when a sink requests a subscription. Source plugins can keep track of subscriptions and may wish to sleep if there are no subscriptions.
 
virtual void unsubscribeToPropertyChanges (const VehicleProperty::Property &property)
 unsubscribeToPropertyChanges is called when a sink requests to unsubscribe from a given property's changes.
 
virtual PropertyList supported () const
 supported is called by the routingEngine to understand what properties this source supports.
 
virtual int supportedOperations () const
 supportedOperations
 
virtual PropertyInfo getPropertyInfo (const VehicleProperty::Property &property)
 getPropertyInfo used to return specific information about a property. The source should override this otherwise a PropertyInfo::invalid() will be returned for the property
 
virtual const std::string uuid () const =0
 
virtual void propertyChanged (AbstractPropertyType *value)
 
virtual void supportedChanged (const PropertyList &supportedProperties)
 
virtual void init ()
 
template<typename T >
void setValue (std::shared_ptr< AbstractPropertyType > property, T value)
 setValue of a property
 

Protected Types

typedef std::map< Zone::Type,
std::shared_ptr
< AbstractPropertyType > > 
ZonePropertyType
 

Protected Member Functions

virtual AbstractPropertyTypefindPropertyType (const VehicleProperty::Property &propertyName, const Zone::Type &zone=Zone::None)
 
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)
 

Protected Attributes

AbstractSourcesource
 
AbstractRoutingEngineroutingEngine
 
std::map
< VehicleProperty::Property,
ZonePropertyType
properties
 
std::map< std::string,
std::string > 
configuration
 

Detailed Description

AmbPlugin private class implementation - base class for all plugin implementations.

Contains common code used in plugins for Automotive message broker(AMB). For the AMB library API please visit Automotive Message Broker Library Documentation.

Member Typedef Documentation

typedef std::map< Zone::Type, std::shared_ptr<AbstractPropertyType> > AmbPluginImpl::ZonePropertyType
protected

Helper typedef

Constructor & Destructor Documentation

AmbPluginImpl::AmbPluginImpl ( AbstractRoutingEngine re,
const map< string, string > &  config,
AbstractSource parent 
)
Parameters
reAbstractRoutingEngine
configMap of the configuration string values loaded on startup from AMB configuration file
parentAmbPlugin instance

Member Function Documentation

std::shared_ptr<AbstractPropertyType> AmbPluginImpl::addPropertySupport ( Zone::Type  zone,
std::function< AbstractPropertyType *(void)>  typeFactory,
std::string  sourceUuid = "" 
)
protected

Registers property in AMB

Parameters
zoneZone of the property to be registered.
typeFactoryFunction to be used to create instance of the AbstractPropertyType for registered property
Returns
AbstractPropertyType* if signal exits otherwise nullptr(in this case we do not know its datatype)
virtual AbstractPropertyType* AmbPluginImpl::findPropertyType ( const VehicleProperty::Property &  propertyName,
const Zone::Type &  zone = Zone::None 
)
protectedvirtual

Finds property type in properties

Parameters
propertyNameName of the property to be found.
zoneZone of the property to be found.
Returns
AbstractPropertyType* if signal exits otherwise nullptr(in this case we do not know its datatype)
virtual void AmbPluginImpl::getPropertyAsync ( AsyncPropertyReply reply)
virtual

getPropertyAsync is called when a sink requests the value for given property. This is only called if the source supports the Get operation.

Parameters
replythe reply variable.

Reimplemented in OpenCvLuxPlugin.

virtual PropertyInfo AmbPluginImpl::getPropertyInfo ( const VehicleProperty::Property &  property)
virtual

getPropertyInfo used to return specific information about a property. The source should override this otherwise a PropertyInfo::invalid() will be returned for the property

Parameters
propertythe property to get info for.
Returns
a PropertyInfo object.
virtual void AmbPluginImpl::getRangePropertyAsync ( AsyncRangePropertyReply reply)
virtual

getRangePropertyAsync is called when a sink requests a series of values for a given property within a specified time or sequencial range. This will only be called if the source support the Ranged Operation.

Parameters
replyis the reply variable.

Reimplemented in DatabaseSink, and OpenCvLuxPlugin.

AmbPluginImpl::init ( )
virtual

Second phase of the plugin initialization.

Reimplemented in CANGenPlugin, DatabaseSink, CANSimPlugin, OpenCvLuxPlugin, BluemonkeySink, GpsNmeaSource, and ChronySink.

virtual void AmbPluginImpl::propertyChanged ( AbstractPropertyType value)
virtual

propertyChanged is called when a subscribed to property changes.

Parameters
valuevalue of the property that changed. this is a temporary pointer that will be destroyed. Do not destroy it. If you need to store the value use value.anyValue(), value.value<T>() or value->copy() to copy.

Reimplemented in DatabaseSink, CANGenPlugin, BluemonkeySink, OpenCvLuxPlugin, and ChronySink.

virtual AsyncPropertyReply* AmbPluginImpl::setProperty ( const AsyncSetPropertyRequest request)
virtual

setProperty is called when a sink requests to set a value for a given property. This is only called if the source supports the Set Operation.

Parameters
requestthe requested property to set.
Returns
returns a pointer to the new value for the property.

Reimplemented in DatabaseSink, and CANGenPlugin.

virtual void AmbPluginImpl::subscribeToPropertyChanges ( const VehicleProperty::Property &  property)
virtual

subscribeToPropertyChanges is called when a sink requests a subscription. Source plugins can keep track of subscriptions and may wish to sleep if there are no subscriptions.

Parameters
propertythe property that is being subscribed.
virtual PropertyList AmbPluginImpl::supported ( ) const
virtual

supported is called by the routingEngine to understand what properties this source supports.

Returns
returns a list of supported properties. If the the supported properties changed, the source should call AbstractRoutingEngine::setSupported.
AmbPluginImpl::supportedChanged ( const PropertyList &  supportedProperties)
virtual

supportedChanged() is called when the supported properties changes

  \param supportedProperties the new list of supported properties.

Reimplemented in DatabaseSink, CANSimPlugin, BluemonkeySink, OpenCvLuxPlugin, and DBusInterfaceManager.

virtual int AmbPluginImpl::supportedOperations ( ) const
virtual

supportedOperations

Returns
returns the supported operations.

Reimplemented in DatabaseSink, CANSimPlugin, and GpsNmeaSource.

virtual void AmbPluginImpl::unsubscribeToPropertyChanges ( const VehicleProperty::Property &  property)
virtual

unsubscribeToPropertyChanges is called when a sink requests to unsubscribe from a given property's changes.

Parameters
propertythe property to unsubscribe to
virtual const std::string AmbPluginImpl::uuid ( ) const
pure virtual

uuid() is a unique identifier

Returns
a guid-style unique identifier

Implemented in DatabaseSink, CANGenPlugin, CANSimPlugin, BluemonkeySink, OpenCvLuxPlugin, ChronySink, GpsNmeaSource, and DBusInterfaceManager.

Member Data Documentation

std::map< std::string, std::string> AmbPluginImpl::configuration
protected

configuration

AmbPluginImpl::properties
protected

Supported property values map

AmbPluginImpl::routingEngine
protected

The documentation for this class was generated from the following file: