22 #ifndef __optix_optix_prime_handle_h__
23 #define __optix_optix_prime_handle_h__
33 template <
class RefCountedObj>
44 explicit Handle( RefCountedObj* ptr );
47 Handle(
const Handle<RefCountedObj>& other);
50 void swap( Handle<RefCountedObj>& other);
54 Handle<RefCountedObj>& operator=(
const Handle<RefCountedObj>& other);
60 Handle<RefCountedObj>& operator=( RefCountedObj* ptr);
74 static Handle<RefCountedObj> create(
RTPcontexttype type ) {
return RefCountedObj::create( type ); }
77 RefCountedObj* operator->()
const;
80 RefCountedObj* m_iptr;
87 template <
class RefCountedObj>
96 template <
class RefCountedObj>
97 inline Handle<RefCountedObj>::Handle( RefCountedObj* ptr ) : m_iptr(ptr)
105 template <
class RefCountedObj>
106 inline Handle<RefCountedObj>::Handle(
const Handle<RefCountedObj>& other ) : m_iptr(other.m_iptr)
115 template <
class RefCountedObj>
116 inline bool Handle<RefCountedObj>::isValid()
const
124 template <
class RefCountedObj>
125 inline void Handle<RefCountedObj>::unref()
136 template <
class RefCountedObj>
137 inline Handle<RefCountedObj>::~Handle()
146 template <
class RefCountedObj>
147 inline Handle<RefCountedObj>& Handle<RefCountedObj>::operator=( RefCountedObj* ptr )
149 Handle<RefCountedObj>(ptr).swap(*
this);
156 template <
class RefCountedObj>
157 inline Handle<RefCountedObj>& Handle<RefCountedObj>::operator=(
const Handle<RefCountedObj>& other )
159 Handle<RefCountedObj>(other).swap(*
this);
166 template <
class RefCountedObj>
167 inline void Handle<RefCountedObj>::swap( Handle<RefCountedObj>& other )
169 RefCountedObj* tmp_iptr = m_iptr;
170 m_iptr = other.m_iptr;
171 other.m_iptr = tmp_iptr;
177 template <
class RefCountedObj>
178 inline RefCountedObj* Handle<RefCountedObj>::operator->()
const
188 #endif // #ifndef __optix_optix_prime_handle_h__
RTPcontexttype
Definition: optix_prime_declarations.h:50
Handle()
Default constructor initializes handle to null pointer.
Definition: optixpp_namespace.h:95