[nostalgia/core] Make AssetContainer non-copyable and non-movable
This commit is contained in:
parent
ec5898a897
commit
1529c82bec
@ -4,9 +4,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ox/model/typenamecatcher.hpp>
|
||||
#include <ox/event/signal.hpp>
|
||||
#include <ox/fs/fs.hpp>
|
||||
#include <ox/model/typenamecatcher.hpp>
|
||||
#include <ox/std/hashmap.hpp>
|
||||
#include <ox/std/utility.hpp>
|
||||
|
||||
@ -18,22 +18,28 @@ template<typename T>
|
||||
class AssetRef;
|
||||
|
||||
template<typename T>
|
||||
struct AssetContainer {
|
||||
class AssetContainer {
|
||||
|
||||
friend AssetManager;
|
||||
friend AssetRef<T>;
|
||||
|
||||
protected:
|
||||
ox::Signal<ox::Error()> updated;
|
||||
|
||||
private:
|
||||
T m_obj;
|
||||
mutable int m_references = 0;
|
||||
|
||||
public:
|
||||
ox::Signal<ox::Error()> updated;
|
||||
|
||||
template<class... Args>
|
||||
explicit constexpr AssetContainer(Args&&... args): m_obj(ox::forward<Args>(args)...) {
|
||||
}
|
||||
|
||||
AssetContainer(AssetContainer&) = delete;
|
||||
AssetContainer(AssetContainer&&) = delete;
|
||||
AssetContainer& operator=(AssetContainer&) = delete;
|
||||
AssetContainer& operator=(AssetContainer&&) = delete;
|
||||
|
||||
constexpr T *get() noexcept {
|
||||
return &m_obj;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user