20 #ifndef ABSTRACTROUTINGENGINE_H
21 #define ABSTRACTROUTINGENGINE_H
23 #include <sys/types.h>
25 #include <boost/any.hpp>
30 #include "vehicleproperty.h"
31 #include "abstractpropertytype.h"
32 #include "propertyinfo.hpp"
41 typedef std::function<void (AsyncPropertyReply*)> GetPropertyCompletedSignal;
42 typedef std::function<void (AsyncRangePropertyReply*)> GetRangedPropertyCompletedSignal;
43 typedef std::function<void (AsyncPropertyReply*)> TimedOutCallback;
170 GSource* timeoutSource;
299 for(
auto itr =
values.begin(); itr !=
values.end(); itr++)
326 typedef std::function<void (AbstractPropertyType* value)> PropertyChangedType;
332 virtual void updateSupported(PropertyList added, PropertyList removed,
AbstractSource* source) = 0;
338 DebugOut(DebugOut::Warning)<<
"updateProperty(VehicleProperty::Property,AbstractPropertyType*,std::string) is deprecated. use new updateProperty(AbstractPropertyType*, const std::string &)"<<endl;
343 virtual PropertyList supported() = 0;
354 virtual std::list<std::string>
sourcesForProperty(
const VehicleProperty::Property & property) = 0;
421 virtual uint
subscribeToProperty(
const VehicleProperty::Property & propertyName, PropertyChangedType callback, std::string pid=
"") = 0;
463 virtual bool subscribeToProperty(
const VehicleProperty::Property & propertyName,
const std::string & sourceUuidFilter, Zone::Type zoneFilter,
AbstractSink *
self) = 0;
467 virtual PropertyInfo getPropertyInfo(
const VehicleProperty::Property &,
const std::string & sourceUuid) = 0;
470 std::map<std::string, std::string> mConfig;
473 #endif // ABSTRACTROUTINGENGINE_H
static const Property NoValue
Various property types:
Definition: vehicleproperty.h:353
double timeEnd
timeEnd set this to request values for the specified property beggining at this time. Time is seconds\ since the unix epoc. Set this to '0' if you do not want values within a time range.
Definition: abstractroutingengine.h:263
Definition: abstractpropertytype.h:69
GetPropertyCompletedSignal completed
completed the callback when the request has been completed.
Definition: abstractroutingengine.h:99
Definition: abstractroutingengine.h:323
TimedOutCallback timedout
timed out callback is called when the reply times out. This is so sources can avoid using this reply ...
Definition: abstractroutingengine.h:160
std::string pid
pid requesting process id
Definition: abstractroutingengine.h:111
The AsyncRangePropertyRequest class is used by sinks to request values within a time or sequence rang...
Definition: abstractroutingengine.h:209
bool success
success indicates if the request was successfull or not. True means success. False means fail and the...
Definition: abstractroutingengine.h:154
bool success
success this will be true if the request was successful. If not, this is false and error is set...
Definition: abstractroutingengine.h:320
double timeBegin
timeBegin set this to request values for the specified property beggining at this time...
Definition: abstractroutingengine.h:257
Zone::Type zoneFilter
zoneFilter the requesting sink should use this if he wants to filter on a specific zone ...
Definition: abstractroutingengine.h:94
int32_t sequenceEnd
sequenceEnd set this to request values with a sequence <= to the sequenceEnd value. Set to -1 if you don't want values within a sequence ranges.
Definition: abstractroutingengine.h:275
Error
The Error enum.
Definition: abstractroutingengine.h:137
std::list< AbstractPropertyType * > values
values if the request was successful, this will contain a list of values meeting the criteria of the ...
Definition: abstractroutingengine.h:315
virtual void registerSink(AbstractSink *self)=0
sinks:
PropertyList properties
properties list of properties to request
Definition: abstractroutingengine.h:235
The AsyncPropertyReply class is used by sources to reply to Get and Set operations. The source should set success to true if the call is successful or 'false' if the request was not successful and set 'error' to the appropriate error.
Definition: abstractroutingengine.h:123
int32_t sequenceBegin
sequenceBegin set this to request values with a sequence >= to the sequenceBegin value. Set to -1 if you don't want values within a sequence ranges.
Definition: abstractroutingengine.h:269
virtual AsyncPropertyReply * getPropertyAsync(AsyncPropertyRequest request)=0
Error error
error contains the error if the request was not successful.\
Definition: abstractroutingengine.h:166
The AsyncSetPropertyRequest class is used by sinks to set a property to the 'value'. The source will reply with a AsyncPropertyReply containing the new value or an error.
Definition: abstractroutingengine.h:179
Definition: propertyinfo.hpp:7
std::string sourceUuid
sourceUuid if the sink wishes to request a specific source, this should be set to the uuid of the sou...
Definition: abstractroutingengine.h:240
virtual void unsubscribeToProperty(uint handle)=0
unsubscribeToProperty
GetRangedPropertyCompletedSignal completed
completed callback that is called when the ranged request is complete. The reply from this request is...
Definition: abstractroutingengine.h:251
The AsyncPropertyRequest class is used by sinks to request property values.
Definition: abstractroutingengine.h:50
VehicleProperty::Property property
property property to request.
Definition: abstractroutingengine.h:84
The AsyncRangePropertyReply class is used by a source to reply to an AsyncRangePropertyRequest. the source should set success to 'true' and populate the 'values' member if the request was successful. If the request is not successful, 'success' should be set to 'false' and the 'error' member should be set.
Definition: abstractroutingengine.h:288
Zone::Type zone
zone if the sink wishes to request a specific zone, this should be set to the desired zone ...
Definition: abstractroutingengine.h:245
std::string sourceUuidFilter
sourceUuidFilter the requesting sink should use this to filter on a specific source or leave blank to...
Definition: abstractroutingengine.h:89
Definition: abstractsink.h:40
virtual std::list< std::string > sourcesForProperty(const VehicleProperty::Property &property)=0
virtual uint subscribeToProperty(const VehicleProperty::Property &propertyName, PropertyChangedType callback, std::string pid="")=0
subscribeToProperty subscribes to propertyName. Value changes will be passed to callback.
std::string pid
pid requesting process id
Definition: abstractroutingengine.h:280
void updateProperty(VehicleProperty::Property property, AbstractPropertyType *value, std::string uuid)
Deprecated:
Definition: abstractroutingengine.h:336
AsyncPropertyReply::Error error
error this is set if there was an error in the request. "success" will also be set to false...
Definition: abstractroutingengine.h:310
AbstractPropertyType * value
value the new value to set the property to.
Definition: abstractroutingengine.h:202
uint timeout
use to specify a timeout in ms for the request. When a timeout occurs, the 'completed' callback will ...
Definition: abstractroutingengine.h:106
Definition: debugout.h:33
AbstractPropertyType * value
value of the reply. This may be null if success = false. This is owned by the source.
Definition: abstractroutingengine.h:148
Definition: abstractsource.h:41