add GL/Buffer

This commit is contained in:
2022-10-07 23:44:35 +09:00
parent 77dc8cef32
commit 58d39739e8
7 changed files with 585 additions and 41 deletions

27
common/factory.hh Normal file
View File

@@ -0,0 +1,27 @@
#pragma once
#include "nf7.hh"
#include "common/future.hh"
namespace nf7 {
template <typename T>
class Factory : public nf7::File::Interface {
public:
using Product = T;
Factory() = default;
Factory(const Factory&) = delete;
Factory(Factory&&) = delete;
Factory& operator=(const Factory&) = delete;
Factory& operator=(Factory&&) = delete;
virtual Product Create() noexcept = 0;
};
template <typename T>
using AsyncFactory = Factory<nf7::Future<T>>;
} // namespace nf7