Disallow copying and moving TagNode

Change-Id: I1a350edaff300c68a4a7314ea984382b88288413
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2020-05-20 16:52:51 +02:00
committed by sys_ocldev
parent 42200bf7f3
commit 71bd96ad71
2 changed files with 6 additions and 1 deletions

View File

@@ -79,6 +79,11 @@ class MockTagAllocator : public TagAllocator<TagType> {
} }
}; };
TEST_F(TagAllocatorTest, givenTagNodeTypeWhenCopyingOrMovingThenDisallow) {
EXPECT_FALSE(std::is_move_constructible<TagNode<TimeStamps>>::value);
EXPECT_FALSE(std::is_copy_constructible<TagNode<TimeStamps>>::value);
}
TEST_F(TagAllocatorTest, Initialize) { TEST_F(TagAllocatorTest, Initialize) {
MockTagAllocator<TimeStamps> tagAllocator(memoryManager, 100, 64, deviceBitfield); MockTagAllocator<TimeStamps> tagAllocator(memoryManager, 100, 64, deviceBitfield);

View File

@@ -23,7 +23,7 @@ template <typename TagType>
class TagAllocator; class TagAllocator;
template <typename TagType> template <typename TagType>
struct TagNode : public IDNode<TagNode<TagType>> { struct TagNode : public IDNode<TagNode<TagType>>, NonCopyableOrMovableClass {
public: public:
TagType *tagForCpuAccess; TagType *tagForCpuAccess;