9 #ifndef _QI_TRACKABLE_HPP_
10 # define _QI_TRACKABLE_HPP_
12 # include <boost/thread/mutex.hpp>
13 # include <boost/shared_ptr.hpp>
14 # include <boost/thread/condition_variable.hpp>
15 # include <boost/function.hpp>
73 boost::shared_ptr<T> _ptr;
74 boost::condition_variable _cond;
82 virtual const char*
what()
const throw()
84 return "Pointer Lock failed";
94 template<
typename RF,
typename AF> boost::function<RF>
bind(
const AF& fun, ...);
104 template<
typename F,
typename ARG0>
105 boost::function<F>
track(boost::function<F> f,
const ARG0& arg0);
113 template<
typename F,
typename ARG0>
114 boost::function<F>
trackWithFallback(boost::function<
void()> onFail, boost::function<F> f,
const ARG0& arg0);
118 #endif // _QI_TRACKABLE_HPP_
QI_API_DEPRECATED_MSG(Use default constructor instead) Trackable(T *ptr)
Various macros for qi. (deprecated, export API, disallow copy, ..) <includename>qi/macro.hpp</includename> .
auto track(F &&f, Arg0 &&arg0) -> decltype(trackWithFallback(detail::throwPointerLockException, std::forward< F >(f), std::forward< Arg0 >(arg0)))
Object tracking by blocking destruction while shared pointers are present.
virtual const char * what() const
auto trackWithFallback(boost::function< void()> onFail, F &&f, Arg0 &&arg0) -> decltype(detail::BindTransform< Arg0 >::wrap(std::forward< Arg0 >(arg0), std::forward< F >(f), std::move(onFail)))
std::enable_if< std::is_function< RF >::value, boost::function< RF > >::type bind(AF &&fun, Arg0 &&arg0, Args &&...args)
Trackable()
Default constructor.
boost::weak_ptr< T > weakPtr()
Common base class to templates Trackable for compile-time detection.