mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 09:33:34 +08:00
Added some comments concerning stack allocation and references
This commit is contained in:
@@ -93,6 +93,9 @@ public:
|
||||
|
||||
ServiceCallID getCallID() const { return call_id_; }
|
||||
|
||||
/**
|
||||
* Returned reference points to a stack-allocated object.
|
||||
*/
|
||||
const ResponseFieldType& getResponse() const { return response_; }
|
||||
ResponseFieldType& getResponse() { return response_; }
|
||||
};
|
||||
@@ -201,6 +204,10 @@ public:
|
||||
* This class can manage multiple concurrent calls to the same or different remote servers. Number of concurrent
|
||||
* calls is limited only by amount of available pool memory.
|
||||
*
|
||||
* Note that the reference passed to the callback points to a stack-allocated object, which means that the
|
||||
* reference invalidates once the callback returns. If you want to use this object after the callback execution,
|
||||
* you need to copy it somewhere.
|
||||
*
|
||||
* @tparam DataType_ Service data type.
|
||||
*
|
||||
* @tparam Callback_ Service response will be delivered through the callback of this type.
|
||||
|
||||
Reference in New Issue
Block a user