small optimizations and os backend refactor
This commit is contained in:
@ -28,7 +28,7 @@ struct SHA1MappedFilesystem_InfoBuilderState {
|
||||
|
||||
SHA1MappedFilesystem::SHA1MappedFilesystem(
|
||||
ObjectStore2& os
|
||||
) : StorageBackendI::StorageBackendI(os), _ibs(std::make_unique<SHA1MappedFilesystem_InfoBuilderState>()) {
|
||||
) : _os(os), _ibs(std::make_unique<SHA1MappedFilesystem_InfoBuilderState>()) {
|
||||
}
|
||||
|
||||
SHA1MappedFilesystem::~SHA1MappedFilesystem(void) {
|
||||
@ -46,10 +46,11 @@ void SHA1MappedFilesystem::tick(void) {
|
||||
}
|
||||
}
|
||||
|
||||
ObjectHandle SHA1MappedFilesystem::newObject(ByteSpan id) {
|
||||
ObjectHandle SHA1MappedFilesystem::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());
|
||||
|
||||
|
@ -11,7 +11,8 @@ namespace Backends {
|
||||
// fwd to hide the threading headers
|
||||
struct SHA1MappedFilesystem_InfoBuilderState;
|
||||
|
||||
struct SHA1MappedFilesystem : public StorageBackendI {
|
||||
struct SHA1MappedFilesystem : public StorageBackendIMeta, public StorageBackendIFile2 {
|
||||
ObjectStore2& _os;
|
||||
std::unique_ptr<SHA1MappedFilesystem_InfoBuilderState> _ibs;
|
||||
|
||||
SHA1MappedFilesystem(
|
||||
@ -23,7 +24,7 @@ struct SHA1MappedFilesystem : public StorageBackendI {
|
||||
// call from main thread (os thread?) often
|
||||
void tick(void);
|
||||
|
||||
ObjectHandle newObject(ByteSpan id) override;
|
||||
ObjectHandle newObject(ByteSpan id, bool throw_construct = true) override;
|
||||
|
||||
// performs async file hashing
|
||||
// create message in cb
|
||||
|
Reference in New Issue
Block a user