Skip to content

Commit

Permalink
Merge pull request #3128 from SergioRAgostinho/function-grabber
Browse files Browse the repository at this point in the history
Add registerCallback overload to pcl grabber to support assignment of  boost functions with templated signatures
  • Loading branch information
taketwo authored Jun 6, 2019
2 parents 32181a2 + 289d8dd commit 575a9b9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion io/include/pcl/io/grabber.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,21 @@ namespace pcl
* \param[in] callback: the callback function/method
* \return Connection object, that can be used to disconnect the callback method from the signal again.
*/
template<typename T> boost::signals2::connection
template<typename T> boost::signals2::connection
registerCallback (const std::function<T>& callback);

/** \brief registers a callback function/method to a signal with the corresponding signature
* \param[in] callback: the callback function/method
* \return Connection object, that can be used to disconnect the callback method from the signal again.
*/
template<typename T, template<typename> class FunctionT>
[[deprecated ("please assign the callback to a std::function.")]]
boost::signals2::connection
registerCallback (const FunctionT<T>& callback)
{
return registerCallback (std::function<T> (callback));
}

/** \brief indicates whether a signal with given parameter-type exists or not
* \return true if signal exists, false otherwise
*/
Expand Down

0 comments on commit 575a9b9

Please sign in to comment.