TVM  0.9.4
ObjWithId.h
Go to the documentation of this file.
1 
3 #pragma once
4 
5 #include <tvm/api.h>
6 
8 
9 namespace tvm::internal
10 {
11 
14 {
15 public:
16  ObjWithId(const ObjWithId &) = delete;
17  ObjWithId(ObjWithId && other) : id_(other.id_) { other.id_ = -1; }
18  ObjWithId & operator=(const ObjWithId &) = delete;
20  {
21  id_ = other.id_;
22  other.id_ = -1;
23  return *this;
24  }
25 
26  int id() const { return id_; }
27 
28 protected:
29  ObjWithId() : id_(ObjWithId::idProvider_.makeId()) {}
30 
31 private:
32  static IdProvider idProvider_;
33  int id_;
34 };
35 
36 } // namespace tvm::internal
#define TVM_DLLAPI
Definition: api.h:35
Definition: IdProvider.h:16
Definition: ObjWithId.h:14
ObjWithId & operator=(ObjWithId &&other)
Definition: ObjWithId.h:19
ObjWithId()
Definition: ObjWithId.h:29
ObjWithId & operator=(const ObjWithId &)=delete
ObjWithId(const ObjWithId &)=delete
int id() const
Definition: ObjWithId.h:26
ObjWithId(ObjWithId &&other)
Definition: ObjWithId.h:17
Definition: CallbackManager.h:12