Maps SDK for C++ 1.0.0
Loading...
Searching...
No Matches
gem::sense::IDataSource Class Referenceabstract

Through this interface data can be obtained from sensors, log files or any other means. More...

Inheritance diagram for gem::sense::IDataSource:
Collaboration diagram for gem::sense::IDataSource:

Public Member Functions

virtual ~IDataSource ()=default
 Default destructor.
virtual int stop ()=0
 Stop the source.
virtual int start ()=0
 Start the source.
virtual bool isStopped () const =0
 Check if source is paused.
virtual EDataSourceType getDataSourceType () const =0
virtual bool isDataTypeAvailable (EDataType type) const =0
 Test if a data type is provided by the data source.
virtual String getDataTypeDescription (EDataType type) const =0
virtual DataTypeList getAvailableDataTypes () const =0
virtual DataPtr getLatestData (EDataType dataType) const =0
virtual int setConfiguration (EDataType type, DataTypeConfigPtr config)
 Update the configuration for the specified type.
virtual DataTypeConfigPtr getConfiguration (EDataType type) const
 Provide access to the current configuration specified to that data type.
virtual int setPreferences (EDataType type, const ParameterList &preferences)=0
 Update the configuration for the specified type.
virtual SearchableParameterList getPreferences (EDataType type) const =0
 Provide access to the current configuration specified to that data type.
virtual int addListener (DataSourceListener listener, EDataType dataType, const ParameterList &preferences=ParameterList(), bool critical=false)=0
 Add a listener to a specific 'dataType'.
virtual int removeListener (DataSourceListener listener, EDataType dataType)=0
 Remove the listener.
virtual void removeListener (DataSourceListener listener)=0
 Remove the listener for all available data types.
virtual EOrigin getOrigin () const
virtual PlaybackPtr getPlayback ()=0
 Get the playback interface.
virtual int setMockData (EDataType type, DataPtr data)
 Set mock data.
virtual bool isMockData (EDataType type) const
 Check if mock data is enabled for the given type.
virtual bool isSDKInstance () const
 Test if this is an SDK instance.
virtual bool pushData (DataPtr data)
 Push new data.

Detailed Description

Through this interface data can be obtained from sensors, log files or any other means.

Member Function Documentation

◆ addListener()

virtual int gem::sense::IDataSource::addListener ( DataSourceListener listener,
EDataType dataType,
const ParameterList & preferences = ParameterList(),
bool critical = false )
pure virtual

Add a listener to a specific 'dataType'.

Parameters
listenerThe listener.
dataTypeType of the data.
preferencesPreferences for specified data type.
criticalNotification critical property.

If critical is true, the notification will be sent immediately from sensor thread

If critical is false, the notification will be sent when API timer ticks

Returns
Error code.
See also
error KNoError

◆ getAvailableDataTypes()

virtual DataTypeList gem::sense::IDataSource::getAvailableDataTypes ( ) const
pure virtual
Returns
The available data types.

◆ getConfiguration()

virtual DataTypeConfigPtr gem::sense::IDataSource::getConfiguration ( EDataType type) const
inlinevirtual

Provide access to the current configuration specified to that data type.

Parameters
typeThe data type for which the configuration will be returned.
Returns
The configuration

◆ getDataSourceType()

virtual EDataSourceType gem::sense::IDataSource::getDataSourceType ( ) const
pure virtual
Returns
The data source type. It can be live or playback.

◆ getDataTypeDescription()

virtual String gem::sense::IDataSource::getDataTypeDescription ( EDataType type) const
pure virtual
Parameters
typeThe data type.
Returns
If data source produces such a data type then it returns a description, otherwise it returns an empty string.

◆ getLatestData()

virtual DataPtr gem::sense::IDataSource::getLatestData ( EDataType dataType) const
pure virtual
Parameters
dataTypeType of the data.
Returns
If data source produces such a data type then it returns a shared data pointer, otherwise it returns an empty shared pointer.

◆ getOrigin()

virtual EOrigin gem::sense::IDataSource::getOrigin ( ) const
inlinevirtual
Returns
The origin of the data source

◆ getPlayback()

virtual PlaybackPtr gem::sense::IDataSource::getPlayback ( )
pure virtual

Get the playback interface.

If data source has no playback capabilities the interface return 0

Returns
The playback listener object.

◆ getPreferences()

virtual SearchableParameterList gem::sense::IDataSource::getPreferences ( EDataType type) const
pure virtual

Provide access to the current configuration specified to that data type.

Parameters
typeThe data type for which the preferences will be returned.
Returns
The configuration.

◆ isDataTypeAvailable()

virtual bool gem::sense::IDataSource::isDataTypeAvailable ( EDataType type) const
pure virtual

Test if a data type is provided by the data source.

Parameters
typeThe data type.
Returns
True if the data type is available, false if not.

◆ isMockData()

virtual bool gem::sense::IDataSource::isMockData ( EDataType type) const
inlinevirtual

Check if mock data is enabled for the given type.

Parameters
[in]typeType of the data.
Returns
enable state

◆ isSDKInstance()

virtual bool gem::sense::IDataSource::isSDKInstance ( ) const
inlinevirtual

Test if this is an SDK instance.

Returns
true if the interface is an SDK instance

◆ isStopped()

virtual bool gem::sense::IDataSource::isStopped ( ) const
pure virtual

Check if source is paused.

Returns
True if stopped, false if not.

◆ pushData()

virtual bool gem::sense::IDataSource::pushData ( DataPtr data)
inlinevirtual

Push new data.

Parameters
[in]datato be pushed.
Returns
false if the push data type is not available

◆ removeListener() [1/2]

virtual void gem::sense::IDataSource::removeListener ( DataSourceListener listener)
pure virtual

Remove the listener for all available data types.

Parameters
listenerThe listener.

◆ removeListener() [2/2]

virtual int gem::sense::IDataSource::removeListener ( DataSourceListener listener,
EDataType dataType )
pure virtual

Remove the listener.

Parameters
listenerThe listener.
dataTypeType of the data.
Returns
Error code.
See also
error KNoError

◆ setConfiguration()

virtual int gem::sense::IDataSource::setConfiguration ( EDataType type,
DataTypeConfigPtr config )
inlinevirtual

Update the configuration for the specified type.

Parameters
configto be applied.
typeType of the data.
Returns
Error code.
See also
error KNoError

◆ setMockData()

virtual int gem::sense::IDataSource::setMockData ( EDataType type,
DataPtr data )
inlinevirtual

Set mock data.

Parameters
[in]typeType of the data.
[in]datato be applied.

If data is empty the mocking will be disabled for the given type

Returns
Error code.
See also
error KNoError

◆ setPreferences()

virtual int gem::sense::IDataSource::setPreferences ( EDataType type,
const ParameterList & preferences )
pure virtual

Update the configuration for the specified type.

Parameters
preferencesto be applied.
typeType of the data.
Returns
Error code.
See also
error KNoError

◆ start()

virtual int gem::sense::IDataSource::start ( )
pure virtual

Start the source.

Returns
Error code.
See also
error KNoError

◆ stop()

virtual int gem::sense::IDataSource::stop ( )
pure virtual

Stop the source.

Returns
Error code.
See also
error KNoError