Commit Graph

19 Commits (24eb1165fcdfe9a4a6561750adac901c6d809e77)

Author SHA1 Message Date
Petr Mikheev f09a689a4f Merge ESM::RefNum and ESM4::FormId 2 years ago
elsid aa77e727b8
Fix build with clang and libc++
libc++ does not have such function:

apps/openmw_test_suite/esm3/testesmwriter.cpp:73:30: error: no member named 'view' in 'std::ostringstream'
            EXPECT_EQ(stream.view().size(), size);
                      ~~~~~~ ^
2 years ago
elsid 5b14ff4470
Add tests to verify RefId size written to ESM file 2 years ago
elsid fd9f652f43
Add CurrentContentFormatVersion to Esm3SaveLoadRecordTest parameters 2 years ago
elsid e3944f741e
Test save/load for all ESM::CellRef fields 2 years ago
florent.teppe 0d17e20490 Implements serialize/deserialize
fixes test compilation.
2 years ago
elsid 9162eaa019
Test more ESM::Player records 2 years ago
elsid 452d1e7e49
Store original string id for Dialogue records 2 years ago
elsid d6c8c54dc5
Generate test cases for all ESM3 format versions since MaxStringRefIdFormatVersion 2 years ago
elsid d1e8e56619
Make QuickKey type a fixed size enum class 2 years ago
elsid 2135eba103
Fix loading ESM3 QuickKeys 2 years ago
elsid 0992624c8b
Support reading and writing typed ESM::RefId to ESM 2 years ago
elsid 80e6d6cbe3
Support variable size strings in ESM3 2 years ago
elsid beb017e699
Do not truncate too long strings on writing ESM 2 years ago
elsid 1e9e7b7607
Add tests to save and load some ESM3 records 2 years ago
clang-format-bot ddb0522bbf
Apply clang-format to code base 2 years ago
Project579 b82176410b Use std::filesystem for unit tests temporary files path. 2 years ago
Project579 e5c417c968 Make sure all paths are passed as std::filesystem::path instead of std::string where possible. 2 years ago
elsid 3affe9913f
Limit the number of simultaneously open not actively used content files
Use LRU cache for ESMReaders. When cache capacity is reached close least
recently used ESMReader. Remember the file name if a reader was open. Once the
reader requested again open the file if there is stored name for it. Put
released ESMReader to the back of the free items list. Close ESMReader's from
the front of the free items list.

Cached item can be used only by one client at the same time. If the same item is
requested twice exception is thrown. This should never happen in practice. If
this happens need to fix the client logic.

It's allowed to go over the capacity limit when requesting different readers.
Ideally this should never happen but there will be system error anyway
signalizing about too many open files. Need to fix client logic in this case.

All places that were using a vector of ESMReaders now using the cache. Cache is
local for each use case and there is no need for a thread safety.
3 years ago