p2p/stingray_sdk/plugin_foundation/com_ptr.h
Lucas Schwiderski 2c9ce46dd2
chore: Rework project structure
There likely won't be much need for multiple separate crates.
2023-05-26 23:42:01 +02:00

31 lines
444 B
C++

#pragma once
#if defined(WINDOWSPC) || defined(XBOXONE)
namespace stingray_plugin_foundation {
template<typename T>
class ComPtr {
public:
explicit ComPtr(T* ptr = 0);
ComPtr(const ComPtr<T>& rhs);
~ComPtr();
ComPtr<T>& operator=(const ComPtr<T>& rhs);
T& operator*() const;
T* operator->() const;
T* get() const;
T* abandon() const;
T** init_ptr();
private:
T* _ptr;
mutable bool _owned;
};
#endif
}
#include "com_ptr.inl"