MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / Wrapper

Class Wrapper

include/CL/opencl.hpp:2064–2155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2062
2063template <typename T>
2064class Wrapper
2065{
2066public:
2067 typedef T cl_type;
2068
2069protected:
2070 cl_type object_;
2071
2072public:
2073 Wrapper() : object_(nullptr) { }
2074
2075 Wrapper(const cl_type &obj, bool retainObject) : object_(obj)
2076 {
2077 if (retainObject) {
2078 detail::errHandler(retain(), __RETAIN_ERR);
2079 }
2080 }
2081
2082 ~Wrapper()
2083 {
2084 if (object_ != nullptr) { release(); }
2085 }
2086
2087 Wrapper(const Wrapper<cl_type>& rhs)
2088 {
2089 object_ = rhs.object_;
2090 detail::errHandler(retain(), __RETAIN_ERR);
2091 }
2092
2093 Wrapper(Wrapper<cl_type>&& rhs) CL_HPP_NOEXCEPT_
2094 {
2095 object_ = rhs.object_;
2096 rhs.object_ = nullptr;
2097 }
2098
2099 Wrapper<cl_type>& operator = (const Wrapper<cl_type>& rhs)
2100 {
2101 if (this != &rhs) {
2102 detail::errHandler(release(), __RELEASE_ERR);
2103 object_ = rhs.object_;
2104 detail::errHandler(retain(), __RETAIN_ERR);
2105 }
2106 return *this;
2107 }
2108
2109 Wrapper<cl_type>& operator = (Wrapper<cl_type>&& rhs)
2110 {
2111 if (this != &rhs) {
2112 detail::errHandler(release(), __RELEASE_ERR);
2113 object_ = rhs.object_;
2114 rhs.object_ = nullptr;
2115 }
2116 return *this;
2117 }
2118
2119 Wrapper<cl_type>& operator = (const cl_type &rhs)
2120 {
2121 detail::errHandler(release(), __RELEASE_ERR);

Callers

nothing calls this directly

Calls 1

errHandlerFunction · 0.85

Tested by

no test coverage detected