ArcGIS Procedural Runtime  3.2.10650
OpaquePtrImpl.h
1 /*
2  COPYRIGHT (c) 2012-2024 Esri R&D Center Zurich
3  TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
4  Unpublished material - all rights reserved under the
5  Copyright Laws of the United States and applicable international
6  laws, treaties, and conventions.
7 
8  For additional information, contact:
9  Environmental Systems Research Institute, Inc.
10  Attn: Contracts and Legal Services Department
11  380 New York Street
12  Redlands, California, 92373
13  USA
14 
15  email: contracts@esri.com
16 */
17 
18 #pragma once
19 
20 #include <utility>
21 
22 
23 namespace prtx {
24 
25 template<typename T>
26 OpaquePtr<T>::OpaquePtr() : m{ new T{} } { }
27 
28 template<typename T>
29 template<typename ...Args>
30 OpaquePtr<T>::OpaquePtr( Args&& ...args ) : m{ new T{ std::forward<Args>(args)... } } { }
31 
32 template<typename T>
33 OpaquePtr<T>::OpaquePtr(OpaquePtr<T> const& other) : m{ new T(*other.m) } { };
34 
35 template<typename T>
36 OpaquePtr<T>::OpaquePtr(OpaquePtr<T>&& other) : m{ std::move(other.m) } { };
37 
38 template<typename T>
39 OpaquePtr<T>& OpaquePtr<T>::operator=(OpaquePtr<T> const& other) {
40  *m = *other.m;
41  return *this;
42 }
43 
44 template<typename T>
45 OpaquePtr<T>& OpaquePtr<T>::operator=(OpaquePtr<T>&& other) {
46  m = std::move(other.m);
47  return *this;
48 }
49 
50 template<typename T>
51 OpaquePtr<T>::~OpaquePtr() = default;
52 
53 template<typename T>
54 T* OpaquePtr<T>::operator->() { return m.get(); }
55 
56 template<typename T>
57 T const* OpaquePtr<T>::operator->() const { return m.get(); }
58 
59 template<typename T>
60 T& OpaquePtr<T>::operator*() { return *m.get(); }
61 
62 } // namespace prtx
The Procedural Runtime eXtension namespace. The prtx namespace contains the tools to extend the Proce...
Definition: AnnotationBuilder.h:35