ae.sys.persistence.core

ae.sys.persistence.core

Members

Enums

FlushPolicy
enum FlushPolicy

When to flush data.

LoadPolicy
enum LoadPolicy

FileCache policy for when to (re)load data from disk.

Manifest constants

filesystemTimestampGranularity
enum filesystemTimestampGranularity;
Undocumented in source.
filesystemTimestampGranularity
enum filesystemTimestampGranularity;
Undocumented in source.
filesystemTimestampGranularity
enum filesystemTimestampGranularity;
Undocumented in source.
filesystemTimestampGranularity
enum filesystemTimestampGranularity;
Undocumented in source.

Mixin templates

CacheCore
mixintemplate CacheCore(alias DataGetter, alias KeyGetter, alias DataPutter = None, FlushPolicy flushPolicy = FlushPolicy.none)

Cache values in-memory, and automatically load/save them as needed via the specified functions. Actual loading/saving is done via alias functions. KeyGetter may return .init (of its return type) if the resource does not yet exist, but once it returns non-.init it may not return .init again. A bool key can be used to load a resource from disk only once (lazily), as is currently done with LoadPolicy.once. Delayed flush policies require a bool key, to avoid mid-air collisions.

Structs

FileCache
struct FileCache(alias DataGetter, alias DataPutter = None, FlushPolicy flushPolicy = FlushPolicy.none, LoadPolicy loadPolicy = LoadPolicy.automatic)

Wraps some data stored in a file on disk.

None
struct None

Placeholder DataPutter argument to indicate no writing.

Meta

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Authors

Vladimir Panteleev <ae@cy.md>