[ox] Make model system's setTypeInfo return an Error

This commit is contained in:
2023-06-09 20:49:36 -05:00
parent 7c3aaf99c2
commit e22743961a
28 changed files with 137 additions and 74 deletions

View File

@@ -145,7 +145,7 @@ constexpr const char *getModelTypeName<FileAddress>() noexcept {
template<typename T>
constexpr Error model(T *io, CommonPtrWith<FileAddress::Data> auto *obj) noexcept {
io->template setTypeInfo<FileAddress::Data>();
oxReturnError(io->template setTypeInfo<FileAddress::Data>());
oxReturnError(io->fieldCString("path", &obj->path));
oxReturnError(io->fieldCString("constPath", &obj->path));
oxReturnError(io->field("inode", &obj->inode));
@@ -154,7 +154,7 @@ constexpr Error model(T *io, CommonPtrWith<FileAddress::Data> auto *obj) noexcep
template<typename T>
constexpr Error model(T *io, CommonPtrWith<FileAddress> auto *fa) noexcept {
io->template setTypeInfo<FileAddress>();
oxReturnError(io->template setTypeInfo<FileAddress>());
if constexpr(T::opType() == OpType::Reflect) {
int8_t type = 0;
oxReturnError(io->field("type", &type));