Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add registerCallback() overload to grabbers to support assignment of boost::functions with templated signatures #3128

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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