未验证 提交 58e1b1eb 编写于 作者: S Sergey Alexandrov 提交者: GitHub

Merge pull request #3615 from kunaltyagi/grabber-toggle

Add a toggle option to grabber
......@@ -57,12 +57,8 @@ namespace pcl
class PCL_EXPORTS Grabber
{
public:
/** \brief Constructor. */
Grabber () {}
/** \brief virtual destructor. */
virtual inline ~Grabber () throw ();
virtual inline ~Grabber () noexcept;
/** \brief registers a callback function/method to a signal with the corresponding signature
* \param[in] callback: the callback function/method
......@@ -101,6 +97,13 @@ namespace pcl
virtual void
stop () = 0;
/** \brief For devices that are streaming, stopped streams are started and running stream are stopped.
* For triggered devices, the behavior is not defined.
* \return true if grabber is running / streaming. False otherwise.
*/
inline bool
toggle ();
/** \brief returns the name of the concrete subclass.
* \return the name of the concrete driver.
*/
......@@ -151,12 +154,25 @@ namespace pcl
std::map<std::string, std::vector<boost::signals2::shared_connection_block> > shared_connections_;
} ;
Grabber::~Grabber () throw ()
Grabber::~Grabber () noexcept
{
for (auto &signal : signals_)
delete signal.second;
}
bool
Grabber::toggle ()
{
if (isRunning ())
{
stop ();
} else
{
start ();
}
return isRunning ();
}
template<typename T> boost::signals2::signal<T>*
Grabber::find_signal () const
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册