automotive-message-broker  0.13
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Modules 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>

Collaboration diagram for AmbPluginImpl:
Collaboration graph
[legend]

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. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual void unsubscribeToPropertyChanges (const VehicleProperty::Property &property)
 unsubscribeToPropertyChanges is called when a sink requests to unsubscribe from a given property's changes. More...
 
virtual PropertyList supported () const
 supported is called by the routingEngine to understand what properties this source supports. More...
 
virtual int supportedOperations () const
 supportedOperations More...
 
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 More...
 
virtual const std::string uuid () const =0
 
virtual void propertyChanged (AbstractPropertyType *value)
 
virtual void supportedChanged (const PropertyList &supportedProperties)
 
virtual void init ()
 

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 all IviPoC II plugins for Automotive message broker(AMB). For the AMB library API please visit Automotive message broker web page.

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)
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)
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.
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.
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.
AmbPluginImpl::init ( )
virtual

Second phase of the plugin initialization.

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.
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.
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.
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

Parameters
supportedPropertiesthe new list of supported properties.
int AmbPluginImpl::supportedOperations ( ) const
virtual

supportedOperations

Returns
returns the supported operations.
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

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 files: