1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-09 04:54:15 +01:00
dxvk/src/util/rc/util_rc.h

36 lines
528 B
C
Raw Normal View History

2017-10-10 23:32:13 +02:00
#pragma once
#include <atomic>
namespace dxvk {
/**
* \brief Reference-counted object
*/
class RcObject {
public:
/**
* \brief Increments reference count
* \returns New reference count
*/
uint32_t incRef() {
return ++m_refCount;
}
/**
* \brief Decrements reference count
* \returns New reference count
*/
uint32_t decRef() {
return --m_refCount;
}
private:
std::atomic<uint32_t> m_refCount = { 0u };
};
}