Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/3rdparty/masm/stubs/wtf/PassOwnPtr.h |
Switch to Source code | Preprocessed file |
Line | Source | Count |
---|---|---|
1 | - | |
2 | template <typename T> class PassOwnPtr; | - |
3 | template <typename PtrType> PassOwnPtr<PtrType> adoptPtr(PtrType*); | - |
4 | - | |
5 | template <typename T> | - |
6 | struct OwnPtr : public QScopedPointer<T> | - |
7 | { | - |
8 | OwnPtr() {} | - |
9 | OwnPtr(const PassOwnPtr<T> &ptr) | - |
10 | : QScopedPointer<T>(ptr.leakRef()) | - |
11 | {} executed 3477529 times by 153 tests: end of block Executed by:
| 3477529 |
12 | - | |
13 | OwnPtr(const OwnPtr<T>& other) | - |
14 | : QScopedPointer<T>(const_cast<OwnPtr<T> &>(other).take()) | - |
15 | {} executed 2329414 times by 153 tests: end of block Executed by:
| 2329414 |
16 | - | |
17 | OwnPtr& operator=(const OwnPtr<T>& other) | - |
18 | { | - |
19 | this->reset(const_cast<OwnPtr<T> &>(other).take()); | - |
20 | return executed 254 times by 2 tests: *this;return *this; Executed by:
executed 254 times by 2 tests: return *this; Executed by:
| 254 |
21 | } | - |
22 | - | |
23 | T* get() const { return executed 4620165 times by 153 tests: this->data();return this->data(); Executed by:
executed 4620165 times by 153 tests: }return this->data(); Executed by:
| 4620165 |
24 | - | |
25 | PassOwnPtr<T> release() | - |
26 | { | - |
27 | return executed 1161128 times by 153 tests: adoptPtr(this->take());return adoptPtr(this->take()); Executed by:
executed 1161128 times by 153 tests: return adoptPtr(this->take()); Executed by:
| 1161128 |
28 | } | - |
29 | }; | - |
30 | - | |
31 | template <typename T> | - |
32 | class PassOwnPtr { | - |
33 | public: | - |
34 | PassOwnPtr() {} | - |
35 | - | |
36 | PassOwnPtr(T* ptr) | - |
37 | : m_ptr(ptr) | - |
38 | { | - |
39 | } never executed: end of block | 0 |
40 | - | |
41 | PassOwnPtr(const PassOwnPtr<T>& other) | - |
42 | : m_ptr(other.leakRef()) | - |
43 | { | - |
44 | } never executed: end of block | 0 |
45 | - | |
46 | PassOwnPtr(const OwnPtr<T>& other) | - |
47 | : m_ptr(other.take()) | - |
48 | { | - |
49 | } never executed: end of block | 0 |
50 | - | |
51 | ~PassOwnPtr() | - |
52 | { | - |
53 | } | - |
54 | - | |
55 | T* operator->() const { return never executed: m_ptr.data();return m_ptr.data(); never executed: }return m_ptr.data(); | 0 |
56 | - | |
57 | T* leakRef() const { return executed 3477831 times by 153 tests: m_ptr.take();return m_ptr.take(); Executed by:
executed 3477831 times by 153 tests: }return m_ptr.take(); Executed by:
| 3477831 |
58 | - | |
59 | private: | - |
60 | template <typename PtrType> friend PassOwnPtr<PtrType> adoptPtr(PtrType*); | - |
61 | - | |
62 | PassOwnPtr<T>& operator=(const PassOwnPtr<T>& t); | - |
63 | - | |
64 | mutable QScopedPointer<T> m_ptr; | - |
65 | }; | - |
66 | - | |
67 | template <typename T> | - |
68 | PassOwnPtr<T> adoptPtr(T* ptr) | - |
69 | { | - |
70 | PassOwnPtr<T> result; | - |
71 | result.m_ptr.reset(ptr); | - |
72 | return executed 3477135 times by 153 tests: result;return result; Executed by:
executed 3477135 times by 153 tests: return result; Executed by:
| 3477135 |
73 | } | - |
Switch to Source code | Preprocessed file |