source: nrEngine/include/SmartPtr.h @ 1

Revision 1, 2.4 KB checked in by art, 13 years ago (diff)
Line 
1/***************************************************************************
2 *                                                                         *
3 *   (c) Art Tevs, MPI Informatik Saarbruecken                             *
4 *       mailto: <tevs@mpi-sb.mpg.de>                                      *
5 *                                                                         *
6 *   This program is free software; you can redistribute it and/or modify  *
7 *   it under the terms of the GNU General Public License as published by  *
8 *   the Free Software Foundation; either version 2 of the License, or     *
9 *   (at your option) any later version.                                   *
10 *                                                                         *
11 ***************************************************************************/
12
13#ifndef __NR_SMART_PTR_H_
14#define __NR_SMART_PTR_H_
15
16
17//----------------------------------------------------------------------------------
18// Includes
19//----------------------------------------------------------------------------------
20#include "Prerequisities.h"
21
22namespace nrEngine{
23
24        //! All smart pointers created whithin this deleter could not be deleted outside
25        /**
26        * This is an null_deleter - deleter. We need this to create smart pointer
27        * (SharedPtr<T>) from our singleton objects. Each pointer created with null
28        * deleter can not be released otherwhere else here. So we can give smart pointer
29        * to our singleton back and we can be sure, that our singleton object will not
30        * be deleted before Release-Function will be executed
31        * @see ::boost.org for smart pointers
32        * \ingroup gp
33        **/
34        struct _NRExport null_deleter{
35                void operator()(void const *) const
36                {
37                }
38        };
39       
40#define SharedPtr boost::shared_ptr
41
42        /**
43         * Smart pointers we are using does not coded extra for nrEngine.
44         * Just use boost's implementation of this for our purpose.
45         *
46         * We use this extra definition to do less typing and to stay in the
47         * same namespace as the engine. So instead of typing
48         * boost::shared_ptr, we simply type SharedPtr.
49         *
50         * \ingroup gp
51         **/
52        /*template<class T>
53        class _NRExport SharedPtr : public boost::shared_ptr<T>{
54                public:
55                        SharedPtr() : boost::shared_ptr<T>(){}
56                        SharedPtr(T* t) : boost::shared_ptr<T>(t){}
57
58                        //! Copyconstructor
59                        SharedPtr(const SharedPtr& ptr) : boost::shared_ptr<T>(ptr) {
60                               
61                        }
62                       
63        };*/
64
65}; // end namespace
66
67#endif
Note: See TracBrowser for help on using the repository browser.