Disallow copying or moving trace buffers
Change-Id: I104b8240a76c6d96ae176b0b26bdc2e4e5e3c180
This commit is contained in:
@@ -36,7 +36,8 @@
|
|||||||
|
|
||||||
namespace roctracer {
|
namespace roctracer {
|
||||||
|
|
||||||
struct TraceBufferBase {
|
class TraceBufferBase {
|
||||||
|
public:
|
||||||
static void FlushAll() {
|
static void FlushAll() {
|
||||||
std::lock_guard lock(mutex_);
|
std::lock_guard lock(mutex_);
|
||||||
|
|
||||||
@@ -58,9 +59,13 @@ struct TraceBufferBase {
|
|||||||
TraceBufferBase(std::string name, int priority)
|
TraceBufferBase(std::string name, int priority)
|
||||||
: name_(std::move(name)), priority_(priority), next_(nullptr) {}
|
: name_(std::move(name)), priority_(priority), next_(nullptr) {}
|
||||||
|
|
||||||
|
TraceBufferBase(const TraceBufferBase&) = delete;
|
||||||
|
TraceBufferBase& operator=(const TraceBufferBase&) = delete;
|
||||||
|
|
||||||
virtual void Flush() = 0;
|
virtual void Flush() = 0;
|
||||||
|
|
||||||
const std::string& name() const { return name_; }
|
std::string name() && { return std::move(name_); }
|
||||||
|
const std::string& name() const& { return name_; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const std::string name_;
|
const std::string name_;
|
||||||
|
|||||||
Reference in New Issue
Block a user