![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Color Oled(SSD1331) connect to STMicroelectronics Nucleo-F466
mbed-os/platform/SharedPtr.h@0:8fdf9a60065b, 2018-10-10 (annotated)
- Committer:
- kadonotakashi
- Date:
- Wed Oct 10 00:33:53 2018 +0000
- Revision:
- 0:8fdf9a60065b
how to make mbed librry
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kadonotakashi | 0:8fdf9a60065b | 1 | /* mbed Microcontroller Library |
kadonotakashi | 0:8fdf9a60065b | 2 | * Copyright (c) 2006-2018 ARM Limited |
kadonotakashi | 0:8fdf9a60065b | 3 | * |
kadonotakashi | 0:8fdf9a60065b | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
kadonotakashi | 0:8fdf9a60065b | 5 | * you may not use this file except in compliance with the License. |
kadonotakashi | 0:8fdf9a60065b | 6 | * You may obtain a copy of the License at |
kadonotakashi | 0:8fdf9a60065b | 7 | * |
kadonotakashi | 0:8fdf9a60065b | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
kadonotakashi | 0:8fdf9a60065b | 9 | * |
kadonotakashi | 0:8fdf9a60065b | 10 | * Unless required by applicable law or agreed to in writing, software |
kadonotakashi | 0:8fdf9a60065b | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
kadonotakashi | 0:8fdf9a60065b | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
kadonotakashi | 0:8fdf9a60065b | 13 | * See the License for the specific language governing permissions and |
kadonotakashi | 0:8fdf9a60065b | 14 | * limitations under the License. |
kadonotakashi | 0:8fdf9a60065b | 15 | */ |
kadonotakashi | 0:8fdf9a60065b | 16 | |
kadonotakashi | 0:8fdf9a60065b | 17 | #ifndef __SHAREDPTR_H__ |
kadonotakashi | 0:8fdf9a60065b | 18 | #define __SHAREDPTR_H__ |
kadonotakashi | 0:8fdf9a60065b | 19 | |
kadonotakashi | 0:8fdf9a60065b | 20 | #include <stdlib.h> |
kadonotakashi | 0:8fdf9a60065b | 21 | |
kadonotakashi | 0:8fdf9a60065b | 22 | #include <stdint.h> |
kadonotakashi | 0:8fdf9a60065b | 23 | #include <stddef.h> |
kadonotakashi | 0:8fdf9a60065b | 24 | |
kadonotakashi | 0:8fdf9a60065b | 25 | #include "platform/mbed_critical.h" |
kadonotakashi | 0:8fdf9a60065b | 26 | |
kadonotakashi | 0:8fdf9a60065b | 27 | /** Shared pointer class. |
kadonotakashi | 0:8fdf9a60065b | 28 | * |
kadonotakashi | 0:8fdf9a60065b | 29 | * A shared pointer is a "smart" pointer that retains ownership of an object using |
kadonotakashi | 0:8fdf9a60065b | 30 | * reference counting accross all smart pointers referencing that object. |
kadonotakashi | 0:8fdf9a60065b | 31 | * |
kadonotakashi | 0:8fdf9a60065b | 32 | * @code |
kadonotakashi | 0:8fdf9a60065b | 33 | * #include "platform/SharedPtr.h" |
kadonotakashi | 0:8fdf9a60065b | 34 | * |
kadonotakashi | 0:8fdf9a60065b | 35 | * void test() { |
kadonotakashi | 0:8fdf9a60065b | 36 | * struct MyStruct { int a; }; |
kadonotakashi | 0:8fdf9a60065b | 37 | * |
kadonotakashi | 0:8fdf9a60065b | 38 | * // Create shared pointer |
kadonotakashi | 0:8fdf9a60065b | 39 | * SharedPtr<MyStruct> ptr( new MyStruct ); |
kadonotakashi | 0:8fdf9a60065b | 40 | * |
kadonotakashi | 0:8fdf9a60065b | 41 | * // Increase reference count |
kadonotakashi | 0:8fdf9a60065b | 42 | * SharedPtr<MyStruct> ptr2( ptr ); |
kadonotakashi | 0:8fdf9a60065b | 43 | * |
kadonotakashi | 0:8fdf9a60065b | 44 | * ptr = NULL; // Reference to the struct instance is still held by ptr2 |
kadonotakashi | 0:8fdf9a60065b | 45 | * |
kadonotakashi | 0:8fdf9a60065b | 46 | * ptr2 = NULL; // The raw pointer is freed |
kadonotakashi | 0:8fdf9a60065b | 47 | * } |
kadonotakashi | 0:8fdf9a60065b | 48 | * @endcode |
kadonotakashi | 0:8fdf9a60065b | 49 | * |
kadonotakashi | 0:8fdf9a60065b | 50 | * |
kadonotakashi | 0:8fdf9a60065b | 51 | * It is similar to the std::shared_ptr class introduced in C++11; |
kadonotakashi | 0:8fdf9a60065b | 52 | * however, this is not a compatible implementation (no weak pointer, no make_shared, no custom deleters and so on.) |
kadonotakashi | 0:8fdf9a60065b | 53 | * |
kadonotakashi | 0:8fdf9a60065b | 54 | * Usage: SharedPtr<Class> ptr(new Class()) |
kadonotakashi | 0:8fdf9a60065b | 55 | * |
kadonotakashi | 0:8fdf9a60065b | 56 | * When ptr is passed around by value, the copy constructor and |
kadonotakashi | 0:8fdf9a60065b | 57 | * destructor manages the reference count of the raw pointer. |
kadonotakashi | 0:8fdf9a60065b | 58 | * If the counter reaches zero, delete is called on the raw pointer. |
kadonotakashi | 0:8fdf9a60065b | 59 | * |
kadonotakashi | 0:8fdf9a60065b | 60 | * To avoid loops, use "weak" references by calling the original |
kadonotakashi | 0:8fdf9a60065b | 61 | * pointer directly through ptr.get(). |
kadonotakashi | 0:8fdf9a60065b | 62 | */ |
kadonotakashi | 0:8fdf9a60065b | 63 | |
kadonotakashi | 0:8fdf9a60065b | 64 | template <class T> |
kadonotakashi | 0:8fdf9a60065b | 65 | class SharedPtr { |
kadonotakashi | 0:8fdf9a60065b | 66 | public: |
kadonotakashi | 0:8fdf9a60065b | 67 | /** |
kadonotakashi | 0:8fdf9a60065b | 68 | * @brief Create empty SharedPtr not pointing to anything. |
kadonotakashi | 0:8fdf9a60065b | 69 | * @details Used for variable declaration. |
kadonotakashi | 0:8fdf9a60065b | 70 | */ |
kadonotakashi | 0:8fdf9a60065b | 71 | SharedPtr(): _ptr(NULL), _counter(NULL) |
kadonotakashi | 0:8fdf9a60065b | 72 | { |
kadonotakashi | 0:8fdf9a60065b | 73 | } |
kadonotakashi | 0:8fdf9a60065b | 74 | |
kadonotakashi | 0:8fdf9a60065b | 75 | /** |
kadonotakashi | 0:8fdf9a60065b | 76 | * @brief Create new SharedPtr |
kadonotakashi | 0:8fdf9a60065b | 77 | * @param ptr Pointer to take control over |
kadonotakashi | 0:8fdf9a60065b | 78 | */ |
kadonotakashi | 0:8fdf9a60065b | 79 | SharedPtr(T *ptr): _ptr(ptr), _counter(NULL) |
kadonotakashi | 0:8fdf9a60065b | 80 | { |
kadonotakashi | 0:8fdf9a60065b | 81 | // Allocate counter on the heap, so it can be shared |
kadonotakashi | 0:8fdf9a60065b | 82 | if (_ptr != NULL) { |
kadonotakashi | 0:8fdf9a60065b | 83 | _counter = new uint32_t; |
kadonotakashi | 0:8fdf9a60065b | 84 | *_counter = 1; |
kadonotakashi | 0:8fdf9a60065b | 85 | } |
kadonotakashi | 0:8fdf9a60065b | 86 | } |
kadonotakashi | 0:8fdf9a60065b | 87 | |
kadonotakashi | 0:8fdf9a60065b | 88 | /** |
kadonotakashi | 0:8fdf9a60065b | 89 | * @brief Destructor. |
kadonotakashi | 0:8fdf9a60065b | 90 | * @details Decrement reference counter, and delete object if no longer pointed to. |
kadonotakashi | 0:8fdf9a60065b | 91 | */ |
kadonotakashi | 0:8fdf9a60065b | 92 | ~SharedPtr() |
kadonotakashi | 0:8fdf9a60065b | 93 | { |
kadonotakashi | 0:8fdf9a60065b | 94 | decrement_counter(); |
kadonotakashi | 0:8fdf9a60065b | 95 | } |
kadonotakashi | 0:8fdf9a60065b | 96 | |
kadonotakashi | 0:8fdf9a60065b | 97 | /** |
kadonotakashi | 0:8fdf9a60065b | 98 | * @brief Copy constructor. |
kadonotakashi | 0:8fdf9a60065b | 99 | * @details Create new SharedPtr from other SharedPtr by |
kadonotakashi | 0:8fdf9a60065b | 100 | * copying pointer to original object and pointer to counter. |
kadonotakashi | 0:8fdf9a60065b | 101 | * @param source Object being copied from. |
kadonotakashi | 0:8fdf9a60065b | 102 | */ |
kadonotakashi | 0:8fdf9a60065b | 103 | SharedPtr(const SharedPtr &source): _ptr(source._ptr), _counter(source._counter) |
kadonotakashi | 0:8fdf9a60065b | 104 | { |
kadonotakashi | 0:8fdf9a60065b | 105 | // Increment reference counter |
kadonotakashi | 0:8fdf9a60065b | 106 | if (_ptr != NULL) { |
kadonotakashi | 0:8fdf9a60065b | 107 | core_util_atomic_incr_u32(_counter, 1); |
kadonotakashi | 0:8fdf9a60065b | 108 | } |
kadonotakashi | 0:8fdf9a60065b | 109 | } |
kadonotakashi | 0:8fdf9a60065b | 110 | |
kadonotakashi | 0:8fdf9a60065b | 111 | /** |
kadonotakashi | 0:8fdf9a60065b | 112 | * @brief Assignment operator. |
kadonotakashi | 0:8fdf9a60065b | 113 | * @details Cleanup previous reference and assign new pointer and counter. |
kadonotakashi | 0:8fdf9a60065b | 114 | * @param source Object being assigned from. |
kadonotakashi | 0:8fdf9a60065b | 115 | * @return Object being assigned. |
kadonotakashi | 0:8fdf9a60065b | 116 | */ |
kadonotakashi | 0:8fdf9a60065b | 117 | SharedPtr operator=(const SharedPtr &source) |
kadonotakashi | 0:8fdf9a60065b | 118 | { |
kadonotakashi | 0:8fdf9a60065b | 119 | if (this != &source) { |
kadonotakashi | 0:8fdf9a60065b | 120 | // Clean up by decrementing counter |
kadonotakashi | 0:8fdf9a60065b | 121 | decrement_counter(); |
kadonotakashi | 0:8fdf9a60065b | 122 | |
kadonotakashi | 0:8fdf9a60065b | 123 | // Assign new values |
kadonotakashi | 0:8fdf9a60065b | 124 | _ptr = source.get(); |
kadonotakashi | 0:8fdf9a60065b | 125 | _counter = source.get_counter(); |
kadonotakashi | 0:8fdf9a60065b | 126 | |
kadonotakashi | 0:8fdf9a60065b | 127 | // Increment new counter |
kadonotakashi | 0:8fdf9a60065b | 128 | if (_ptr != NULL) { |
kadonotakashi | 0:8fdf9a60065b | 129 | core_util_atomic_incr_u32(_counter, 1); |
kadonotakashi | 0:8fdf9a60065b | 130 | } |
kadonotakashi | 0:8fdf9a60065b | 131 | } |
kadonotakashi | 0:8fdf9a60065b | 132 | |
kadonotakashi | 0:8fdf9a60065b | 133 | return *this; |
kadonotakashi | 0:8fdf9a60065b | 134 | } |
kadonotakashi | 0:8fdf9a60065b | 135 | |
kadonotakashi | 0:8fdf9a60065b | 136 | /** |
kadonotakashi | 0:8fdf9a60065b | 137 | * @brief Replaces the managed pointer with a new unmanaged pointer. |
kadonotakashi | 0:8fdf9a60065b | 138 | * @param[in] ptr the new raw pointer to manage. |
kadonotakashi | 0:8fdf9a60065b | 139 | */ |
kadonotakashi | 0:8fdf9a60065b | 140 | void reset(T *ptr) |
kadonotakashi | 0:8fdf9a60065b | 141 | { |
kadonotakashi | 0:8fdf9a60065b | 142 | // Clean up by decrementing counter |
kadonotakashi | 0:8fdf9a60065b | 143 | decrement_counter(); |
kadonotakashi | 0:8fdf9a60065b | 144 | |
kadonotakashi | 0:8fdf9a60065b | 145 | if (ptr != NULL) { |
kadonotakashi | 0:8fdf9a60065b | 146 | // Allocate counter on the heap, so it can be shared |
kadonotakashi | 0:8fdf9a60065b | 147 | _counter = new uint32_t; |
kadonotakashi | 0:8fdf9a60065b | 148 | *_counter = 1; |
kadonotakashi | 0:8fdf9a60065b | 149 | } |
kadonotakashi | 0:8fdf9a60065b | 150 | } |
kadonotakashi | 0:8fdf9a60065b | 151 | |
kadonotakashi | 0:8fdf9a60065b | 152 | /** |
kadonotakashi | 0:8fdf9a60065b | 153 | * @brief Replace the managed pointer with a NULL pointer. |
kadonotakashi | 0:8fdf9a60065b | 154 | */ |
kadonotakashi | 0:8fdf9a60065b | 155 | void reset() |
kadonotakashi | 0:8fdf9a60065b | 156 | { |
kadonotakashi | 0:8fdf9a60065b | 157 | reset(NULL); |
kadonotakashi | 0:8fdf9a60065b | 158 | } |
kadonotakashi | 0:8fdf9a60065b | 159 | |
kadonotakashi | 0:8fdf9a60065b | 160 | /** |
kadonotakashi | 0:8fdf9a60065b | 161 | * @brief Raw pointer accessor. |
kadonotakashi | 0:8fdf9a60065b | 162 | * @details Get raw pointer to object pointed to. |
kadonotakashi | 0:8fdf9a60065b | 163 | * @return Pointer. |
kadonotakashi | 0:8fdf9a60065b | 164 | */ |
kadonotakashi | 0:8fdf9a60065b | 165 | T *get() const |
kadonotakashi | 0:8fdf9a60065b | 166 | { |
kadonotakashi | 0:8fdf9a60065b | 167 | return _ptr; |
kadonotakashi | 0:8fdf9a60065b | 168 | } |
kadonotakashi | 0:8fdf9a60065b | 169 | |
kadonotakashi | 0:8fdf9a60065b | 170 | /** |
kadonotakashi | 0:8fdf9a60065b | 171 | * @brief Reference count accessor. |
kadonotakashi | 0:8fdf9a60065b | 172 | * @return Reference count. |
kadonotakashi | 0:8fdf9a60065b | 173 | */ |
kadonotakashi | 0:8fdf9a60065b | 174 | uint32_t use_count() const |
kadonotakashi | 0:8fdf9a60065b | 175 | { |
kadonotakashi | 0:8fdf9a60065b | 176 | if (_ptr != NULL) { |
kadonotakashi | 0:8fdf9a60065b | 177 | core_util_critical_section_enter(); |
kadonotakashi | 0:8fdf9a60065b | 178 | uint32_t current_counter = *_counter; |
kadonotakashi | 0:8fdf9a60065b | 179 | core_util_critical_section_exit(); |
kadonotakashi | 0:8fdf9a60065b | 180 | return current_counter; |
kadonotakashi | 0:8fdf9a60065b | 181 | } else { |
kadonotakashi | 0:8fdf9a60065b | 182 | return 0; |
kadonotakashi | 0:8fdf9a60065b | 183 | } |
kadonotakashi | 0:8fdf9a60065b | 184 | } |
kadonotakashi | 0:8fdf9a60065b | 185 | |
kadonotakashi | 0:8fdf9a60065b | 186 | /** |
kadonotakashi | 0:8fdf9a60065b | 187 | * @brief Dereference object operator. |
kadonotakashi | 0:8fdf9a60065b | 188 | * @details Override to return the object pointed to. |
kadonotakashi | 0:8fdf9a60065b | 189 | */ |
kadonotakashi | 0:8fdf9a60065b | 190 | T &operator*() const |
kadonotakashi | 0:8fdf9a60065b | 191 | { |
kadonotakashi | 0:8fdf9a60065b | 192 | return *_ptr; |
kadonotakashi | 0:8fdf9a60065b | 193 | } |
kadonotakashi | 0:8fdf9a60065b | 194 | |
kadonotakashi | 0:8fdf9a60065b | 195 | /** |
kadonotakashi | 0:8fdf9a60065b | 196 | * @brief Dereference object member operator. |
kadonotakashi | 0:8fdf9a60065b | 197 | * @details Override to return return member in object pointed to. |
kadonotakashi | 0:8fdf9a60065b | 198 | */ |
kadonotakashi | 0:8fdf9a60065b | 199 | T *operator->() const |
kadonotakashi | 0:8fdf9a60065b | 200 | { |
kadonotakashi | 0:8fdf9a60065b | 201 | return _ptr; |
kadonotakashi | 0:8fdf9a60065b | 202 | } |
kadonotakashi | 0:8fdf9a60065b | 203 | |
kadonotakashi | 0:8fdf9a60065b | 204 | /** |
kadonotakashi | 0:8fdf9a60065b | 205 | * @brief Boolean conversion operator. |
kadonotakashi | 0:8fdf9a60065b | 206 | * @return Whether or not the pointer is NULL. |
kadonotakashi | 0:8fdf9a60065b | 207 | */ |
kadonotakashi | 0:8fdf9a60065b | 208 | operator bool() const |
kadonotakashi | 0:8fdf9a60065b | 209 | { |
kadonotakashi | 0:8fdf9a60065b | 210 | return (_ptr != NULL); |
kadonotakashi | 0:8fdf9a60065b | 211 | } |
kadonotakashi | 0:8fdf9a60065b | 212 | |
kadonotakashi | 0:8fdf9a60065b | 213 | private: |
kadonotakashi | 0:8fdf9a60065b | 214 | /** |
kadonotakashi | 0:8fdf9a60065b | 215 | * @brief Get pointer to reference counter. |
kadonotakashi | 0:8fdf9a60065b | 216 | * @return Pointer to reference counter. |
kadonotakashi | 0:8fdf9a60065b | 217 | */ |
kadonotakashi | 0:8fdf9a60065b | 218 | uint32_t *get_counter() const |
kadonotakashi | 0:8fdf9a60065b | 219 | { |
kadonotakashi | 0:8fdf9a60065b | 220 | return _counter; |
kadonotakashi | 0:8fdf9a60065b | 221 | } |
kadonotakashi | 0:8fdf9a60065b | 222 | |
kadonotakashi | 0:8fdf9a60065b | 223 | /** |
kadonotakashi | 0:8fdf9a60065b | 224 | * @brief Decrement reference counter. |
kadonotakashi | 0:8fdf9a60065b | 225 | * @details If count reaches zero, free counter and delete object pointed to. |
kadonotakashi | 0:8fdf9a60065b | 226 | */ |
kadonotakashi | 0:8fdf9a60065b | 227 | void decrement_counter() |
kadonotakashi | 0:8fdf9a60065b | 228 | { |
kadonotakashi | 0:8fdf9a60065b | 229 | if (_ptr != NULL) { |
kadonotakashi | 0:8fdf9a60065b | 230 | uint32_t new_value = core_util_atomic_decr_u32(_counter, 1); |
kadonotakashi | 0:8fdf9a60065b | 231 | if (new_value == 0) { |
kadonotakashi | 0:8fdf9a60065b | 232 | delete _counter; |
kadonotakashi | 0:8fdf9a60065b | 233 | _counter = NULL; |
kadonotakashi | 0:8fdf9a60065b | 234 | delete _ptr; |
kadonotakashi | 0:8fdf9a60065b | 235 | _ptr = NULL; |
kadonotakashi | 0:8fdf9a60065b | 236 | } |
kadonotakashi | 0:8fdf9a60065b | 237 | } |
kadonotakashi | 0:8fdf9a60065b | 238 | } |
kadonotakashi | 0:8fdf9a60065b | 239 | |
kadonotakashi | 0:8fdf9a60065b | 240 | private: |
kadonotakashi | 0:8fdf9a60065b | 241 | // Pointer to shared object |
kadonotakashi | 0:8fdf9a60065b | 242 | T *_ptr; |
kadonotakashi | 0:8fdf9a60065b | 243 | |
kadonotakashi | 0:8fdf9a60065b | 244 | // Pointer to shared reference counter |
kadonotakashi | 0:8fdf9a60065b | 245 | uint32_t *_counter; |
kadonotakashi | 0:8fdf9a60065b | 246 | }; |
kadonotakashi | 0:8fdf9a60065b | 247 | |
kadonotakashi | 0:8fdf9a60065b | 248 | /** Non-member relational operators. |
kadonotakashi | 0:8fdf9a60065b | 249 | */ |
kadonotakashi | 0:8fdf9a60065b | 250 | template <class T, class U> |
kadonotakashi | 0:8fdf9a60065b | 251 | bool operator== (const SharedPtr<T> &lhs, const SharedPtr<U> &rhs) |
kadonotakashi | 0:8fdf9a60065b | 252 | { |
kadonotakashi | 0:8fdf9a60065b | 253 | return (lhs.get() == rhs.get()); |
kadonotakashi | 0:8fdf9a60065b | 254 | } |
kadonotakashi | 0:8fdf9a60065b | 255 | |
kadonotakashi | 0:8fdf9a60065b | 256 | template <class T, typename U> |
kadonotakashi | 0:8fdf9a60065b | 257 | bool operator== (const SharedPtr<T> &lhs, U rhs) |
kadonotakashi | 0:8fdf9a60065b | 258 | { |
kadonotakashi | 0:8fdf9a60065b | 259 | return (lhs.get() == (T *) rhs); |
kadonotakashi | 0:8fdf9a60065b | 260 | } |
kadonotakashi | 0:8fdf9a60065b | 261 | |
kadonotakashi | 0:8fdf9a60065b | 262 | template <class T, typename U> |
kadonotakashi | 0:8fdf9a60065b | 263 | bool operator== (U lhs, const SharedPtr<T> &rhs) |
kadonotakashi | 0:8fdf9a60065b | 264 | { |
kadonotakashi | 0:8fdf9a60065b | 265 | return ((T *) lhs == rhs.get()); |
kadonotakashi | 0:8fdf9a60065b | 266 | } |
kadonotakashi | 0:8fdf9a60065b | 267 | |
kadonotakashi | 0:8fdf9a60065b | 268 | /** Non-member relational operators. |
kadonotakashi | 0:8fdf9a60065b | 269 | */ |
kadonotakashi | 0:8fdf9a60065b | 270 | template <class T, class U> |
kadonotakashi | 0:8fdf9a60065b | 271 | bool operator!= (const SharedPtr<T> &lhs, const SharedPtr<U> &rhs) |
kadonotakashi | 0:8fdf9a60065b | 272 | { |
kadonotakashi | 0:8fdf9a60065b | 273 | return (lhs.get() != rhs.get()); |
kadonotakashi | 0:8fdf9a60065b | 274 | } |
kadonotakashi | 0:8fdf9a60065b | 275 | |
kadonotakashi | 0:8fdf9a60065b | 276 | template <class T, typename U> |
kadonotakashi | 0:8fdf9a60065b | 277 | bool operator!= (const SharedPtr<T> &lhs, U rhs) |
kadonotakashi | 0:8fdf9a60065b | 278 | { |
kadonotakashi | 0:8fdf9a60065b | 279 | return (lhs.get() != (T *) rhs); |
kadonotakashi | 0:8fdf9a60065b | 280 | } |
kadonotakashi | 0:8fdf9a60065b | 281 | |
kadonotakashi | 0:8fdf9a60065b | 282 | template <class T, typename U> |
kadonotakashi | 0:8fdf9a60065b | 283 | bool operator!= (U lhs, const SharedPtr<T> &rhs) |
kadonotakashi | 0:8fdf9a60065b | 284 | { |
kadonotakashi | 0:8fdf9a60065b | 285 | return ((T *) lhs != rhs.get()); |
kadonotakashi | 0:8fdf9a60065b | 286 | } |
kadonotakashi | 0:8fdf9a60065b | 287 | |
kadonotakashi | 0:8fdf9a60065b | 288 | #endif // __SHAREDPTR_H__ |