opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
file_backed_storage.h
Go to the documentation of this file.
1#pragma once
2
5
6#include <filesystem>
7#include <unordered_map>
8
9namespace OpenSim { class Model; }
10namespace OpenSim { class Storage; }
11
12namespace opyn
13{
14 // an `OpenSim::Storage` that's backed by an on-disk file.
15 class FileBackedStorage final {
16 public:
17 explicit FileBackedStorage(const OpenSim::Model&, std::filesystem::path sourceFile);
21 FileBackedStorage& operator=(FileBackedStorage&&) noexcept;
22 ~FileBackedStorage() noexcept;
23
25
26 osc::ClosedInterval<float> timeRange() const;
27 const OpenSim::Storage& storage() const { return *m_Storage; }
28 const std::unordered_map<int, int>& mapper() const { return m_StorageIndexToModelStateVarIndexMap; }
29 private:
30 std::filesystem::path m_SourceFile;
32 std::unordered_map<int, int> m_StorageIndexToModelStateVarIndexMap;
33 };
34}
Definition file_backed_storage.h:15
void reloadFromDisk(const OpenSim::Model &)
const std::unordered_map< int, int > & mapper() const
Definition file_backed_storage.h:28
FileBackedStorage(FileBackedStorage &&) noexcept
osc::ClosedInterval< float > timeRange() const
const OpenSim::Storage & storage() const
Definition file_backed_storage.h:27
FileBackedStorage(const OpenSim::Model &, std::filesystem::path sourceFile)
FileBackedStorage(const FileBackedStorage &)
Definition model.h:26
Definition clone_ptr.h:18
Definition static_component_registries.h:3
Definition component_registry.h:14
Definition custom_decoration_generator.h:5