Files
vk_expe/src/vk/Wrapper.cpp
2022-03-05 11:33:00 +01:00

50 lines
772 B
C++

// Copyright 2022 Simon Boyé
#include <vk/Wrapper.h>
#include <vk/Context.h>
#include <cassert>
namespace vk {
Wrapper::Wrapper() noexcept {
}
Wrapper::Wrapper(Context& context, Flags flags) noexcept
: m_context(&context)
, m_flags(flags)
{
assert(m_context);
}
Wrapper::Wrapper(const Wrapper& other) noexcept
: m_context(other.m_context)
{}
Wrapper::Wrapper(Wrapper&& other) noexcept
{
swap(other);
}
Wrapper::~Wrapper() noexcept {
}
Wrapper& Wrapper::operator=(const Wrapper& other) noexcept {
if (&other != this) {
m_context = other.m_context;
m_flags = other.m_flags & ~OwnUnderlyingObject;
}
return *this;
}
Wrapper& Wrapper::operator=(Wrapper&& other) noexcept {
swap(other);
return *this;
}
}