[ox/std] Update TraceMsg model
This commit is contained in:
parent
85f3904115
commit
bccae1c613
8
deps/ox/src/ox/std/trace.hpp
vendored
8
deps/ox/src/ox/std/trace.hpp
vendored
@ -27,6 +27,9 @@ void oxTraceHook(const char *file, int line, const char *ch, const char *msg);
|
|||||||
namespace ox::trace {
|
namespace ox::trace {
|
||||||
|
|
||||||
struct TraceMsg {
|
struct TraceMsg {
|
||||||
|
static constexpr auto TypeName = "net.drinkingtea.ox.trace.TraceMsg";
|
||||||
|
static constexpr auto Fields = 5;
|
||||||
|
static constexpr auto TypeVersion = 1;
|
||||||
const char *file = "";
|
const char *file = "";
|
||||||
int line = 0;
|
int line = 0;
|
||||||
uint64_t time = 0;
|
uint64_t time = 0;
|
||||||
@ -36,14 +39,13 @@ struct TraceMsg {
|
|||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
constexpr Error model(T *io, ox::trace::TraceMsg *obj) {
|
constexpr Error model(T *io, ox::trace::TraceMsg *obj) {
|
||||||
auto err = OxError(0);
|
io->template setTypeInfo<TraceMsg>();
|
||||||
io->setTypeInfo("ox::trace::TraceMsg", 5);
|
|
||||||
oxReturnError(io->field("ch", &obj->ch));
|
oxReturnError(io->field("ch", &obj->ch));
|
||||||
oxReturnError(io->field("file", &obj->file));
|
oxReturnError(io->field("file", &obj->file));
|
||||||
oxReturnError(io->field("line", &obj->line));
|
oxReturnError(io->field("line", &obj->line));
|
||||||
oxReturnError(io->field("time", &obj->time));
|
oxReturnError(io->field("time", &obj->time));
|
||||||
oxReturnError(io->field("msg", &obj->msg));
|
oxReturnError(io->field("msg", &obj->msg));
|
||||||
return err;
|
return OxError(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
class OutStream {
|
class OutStream {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user