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>
54 boost::shared_ptr<T>
lock();
77 boost::shared_ptr<T> _ptr;
78 boost::condition_variable _cond;
86 virtual const char*
what()
const throw()
88 return "Pointer Lock failed";
98 template<
typename RF,
typename AF> boost::function<RF>
bind(
const AF& fun, ...);
108 template<
typename F,
typename ARG0>
109 boost::function<F>
track(
const boost::function<F>& f,
const ARG0& arg0);
117 template<
typename F,
typename ARG0>
119 const boost::function<F>& f,
const ARG0& arg0);
123 #endif // _QI_TRACKABLE_HPP_
boost::function< RF > bind(const AF &fun,...)
boost::shared_ptr< T > lock()
Trackable(T *ptr)
Default constructor.
boost::function< F > track(const boost::function< F > &f, const ARG0 &arg0)
Wrap given function f with a tracking check on arg0, which must be a weak pointer or a Trackable inst...
boost::function< F > trackWithFallback(boost::function< void()> onFail, const boost::function< F > &f, const ARG0 &arg0)
Wrap given function f with a tracking check on arg0, which must be a weak pointer or a Trackable inst...
~Trackable()
Default destructor.
Object tracking by blocking destruction while shared pointers are present.
virtual const char * what() const
boost::weak_ptr< T > weakPtr()
Common base class to templates Trackable for compile-time detection.