summaryrefslogtreecommitdiff
path: root/include/JSystem/JGadget/pointer.h
blob: 183684237f2f697e0f73a0b69faab885023e5c6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef POINTER_H
#define POINTER_H

namespace JGadget {

template<class T>
class TPointer {
public:
    TPointer(T* ptr) : mPtr(ptr) {}
    void set(T* ptr) { mPtr = ptr; }
    T* mPtr;
};

template<class T>
class TPointer_delete : public TPointer<T> {
public:
    TPointer_delete(T* ptr) : TPointer(ptr) {}
    ~TPointer_delete() {
        delete mPtr;
    }
};

}

#endif