Disallow copying or moving trace buffers
Change-Id: I104b8240a76c6d96ae176b0b26bdc2e4e5e3c180
이 커밋은 다음에 포함됨:
1 부모
67481bd295
커밋
3f402eb6e9
1 파일이 변경됨
+7
-2
@@ -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_;
|
||||||
|
|||||||
새 이슈에서 참조
사용자 차단