StelObjectType.hpp   StelObjectType.hpp 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA.
*/ */
#ifndef _STELOBJECTTYPE_HPP_ #ifndef _STELOBJECTTYPE_HPP_
#define _STELOBJECTTYPE_HPP_ #define _STELOBJECTTYPE_HPP_
#include <boost/intrusive_ptr.hpp> #include <QSharedPointer>
//! Special version of QSharedPointer which by default doesn't delete the r
eferenced pointer when
//! the reference count reaches 0.
template <class T> class QSharedPointerNoDelete : public QSharedPointer<T>
{
public:
QSharedPointerNoDelete() {;}
QSharedPointerNoDelete(T *ptr) : QSharedPointer<T>(ptr, QSharedPoint
erNoDelete::noDelete) {;}
QSharedPointerNoDelete(T *ptr, bool own) : QSharedPointer<T>(ptr) {Q
_ASSERT(own==true);}
QSharedPointerNoDelete(const QSharedPointer<T>& ptr) : QSharedPointe
r<T>(ptr) {;}
static void noDelete(T *ptr) {;}
inline operator const QSharedPointer<T>&() const {return *(static_ca
st<QSharedPointer<T> >(this));}
};
//! @file StelObjectType.hpp //! @file StelObjectType.hpp
//! Define the StelObjectP type. //! Define the StelObjectP type.
class StelObject; class StelObject;
//! @typedef StelObjectP //! @typedef StelObjectP
//! Intrusive pointer used to manage StelObject with smart pointers //! Intrusive pointer used to manage StelObject with smart pointers
typedef boost::intrusive_ptr<StelObject> StelObjectP; typedef QSharedPointerNoDelete<StelObject> StelObjectP;
#endif // _STELOBJECTTYPE_HPP_ #endif // _STELOBJECTTYPE_HPP_
 End of changes. 2 change blocks. 
2 lines changed or deleted 20 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/