os backend refactor
This commit is contained in:
@ -11,20 +11,23 @@ namespace Backends {
|
||||
|
||||
ToxFTFilesystem::ToxFTFilesystem(
|
||||
ObjectStore2& os
|
||||
) : StorageBackendI::StorageBackendI(os) {
|
||||
) : _os(os) {
|
||||
}
|
||||
|
||||
ToxFTFilesystem::~ToxFTFilesystem(void) {
|
||||
}
|
||||
|
||||
ObjectHandle ToxFTFilesystem::newObject(ByteSpan id) {
|
||||
ObjectHandle ToxFTFilesystem::newObject(ByteSpan id, bool throw_construct) {
|
||||
ObjectHandle o{_os.registry(), _os.registry().create()};
|
||||
|
||||
o.emplace<ObjComp::Ephemeral::Backend>(this);
|
||||
o.emplace<ObjComp::Ephemeral::BackendMeta>(this);
|
||||
o.emplace<ObjComp::Ephemeral::BackendFile2>(this);
|
||||
o.emplace<ObjComp::ID>(std::vector<uint8_t>{id});
|
||||
//o.emplace<ObjComp::Ephemeral::FilePath>(object_file_path.generic_u8string());
|
||||
|
||||
_os.throwEventConstruct(o);
|
||||
if (throw_construct) {
|
||||
_os.throwEventConstruct(o);
|
||||
}
|
||||
|
||||
return o;
|
||||
}
|
||||
|
@ -4,13 +4,15 @@
|
||||
|
||||
namespace Backends {
|
||||
|
||||
struct ToxFTFilesystem : public StorageBackendI {
|
||||
struct ToxFTFilesystem : public StorageBackendIMeta, public StorageBackendIFile2 {
|
||||
ObjectStore2& _os;
|
||||
|
||||
ToxFTFilesystem(
|
||||
ObjectStore2& os
|
||||
);
|
||||
~ToxFTFilesystem(void);
|
||||
|
||||
ObjectHandle newObject(ByteSpan id) override;
|
||||
ObjectHandle newObject(ByteSpan id, bool throw_construct = true) override;
|
||||
|
||||
std::unique_ptr<File2I> file2(Object o, FILE2_FLAGS flags) override;
|
||||
};
|
||||
|
Reference in New Issue
Block a user