From 2eef99294629a67ac10b1dd181adc57e97e61cb0 Mon Sep 17 00:00:00 2001 From: Kevron Rees Date: Wed, 23 Oct 2013 21:32:33 -0700 Subject: [PATCH] added comments --- lib/abstractroutingengine.h | 46 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/lib/abstractroutingengine.h b/lib/abstractroutingengine.h index abd1d34..955283d 100644 --- a/lib/abstractroutingengine.h +++ b/lib/abstractroutingengine.h @@ -324,18 +324,60 @@ public: virtual std::list sourcesForProperty(VehicleProperty::Property property) = 0; /** - * /brief getPropertyAsync requests a property value from a source. This call has a timeout and will always return. + * /brief getPropertyAsync requests a property value from a source. This call has a timeout and the callback specified in the request will always be called. * /see AsyncPropertyRequest * /see AsyncPropertyReply. * /param request requested property. * /return AsyncPropertyReply. The returned AsyncPropertyReply is owned by the caller of getPropertyAsync. * /example AsyncPropertyRequest request; * request.property = VehicleProperty::VehicleSpeed - * request.completed = [](AsyncPropertyReply* reply) { delete reply; }; + * request.completed = [](AsyncPropertyReply* reply) + * { + * //you own the reply + * delete reply; + * }; * routingEngine->getPropertyAsync(request); */ virtual AsyncPropertyReply * getPropertyAsync(AsyncPropertyRequest request) = 0; + + /*! + * \brief getRangePropertyAsync is used for getting a range of properties that are within the specified time or sequence parameters. + * \param request the request containing the property and other information required by the query + * \return a pointer to the reply. + * \example AsyncRangePropertyRequest vehicleSpeedFromLastWeek; + * + * vehicleSpeedFromLastWeek.timeBegin = amb::currentTime() - 10; + * vehicleSpeedFromLastWeek.timeEnd = amb::currentTime(); + * + * PropertyList requestList; + * requestList.push_back(VehicleProperty::VehicleSpeed); + * requestList.push_back(VehicleProperty::EngineSpeed); + * + * vehicleSpeedFromLastWeek.properties = requestList; + * vehicleSpeedFromLastWeek.completed = [](AsyncRangePropertyReply* reply) + * { + * std::list values = reply->values; + * for(auto itr = values.begin(); itr != values.end(); itr++) + * { + * auto val = *itr; + * DebugOut(1)<<"Value from past: ("<name<<"): "<toString()<<" time: "<timestamp<getRangePropertyAsync(vehicleSpeedFromLastWeek); + * + */ virtual AsyncRangePropertyReply * getRangePropertyAsync(AsyncRangePropertyRequest request) = 0; + + /*! + * \brief setProperty sets a property to a value. + * \see AsyncSetPropertyRequest + * \see AsyncPropertyReply + * \param request the request containing the property and the value to set + * \return a pointer to the reply which is owned by the caller of this method + */ virtual AsyncPropertyReply * setProperty(AsyncSetPropertyRequest request) = 0; virtual void subscribeToProperty(VehicleProperty::Property, AbstractSink* self) = 0; virtual void subscribeToProperty(VehicleProperty::Property, std::string sourceUuidFilter, AbstractSink *self) = 0; -- 2.7.4