diff --git a/docs/custom_dataset.rst b/docs/custom_dataset.rst index b7bba6c..3dac97c 100644 --- a/docs/custom_dataset.rst +++ b/docs/custom_dataset.rst @@ -19,25 +19,41 @@ Serialized Database namespace cvt { + struct EntryMeta { + std::string location; + float some_property; + }; + struct MyDatasetEntry { - ReplayInfo header; + using header_type = EntryMeta; + + EntryMeta header; std::vector timeseriesA; std::vector timeseriesB; }; template<> struct DatabaseInterface { - static auto getHeaderImpl(std::istream &dbStream) -> ReplayInfo + static auto getHeaderImpl(std::istream &dbStream) -> EntryMeta { - ReplayInfo result; + EntryMeta result; deserialize(result, dbStream); return result; - }; + } + + static auto getEntryImpl(std::istream &dbStream) -> MyDatasetEntry + { + MyDatasetEntry data; + deserialize(data, dbStream); + return data; + } // Implement other methods }; + using CustomDatabase = ReplayDatabase; + } // namespace cvt