nw::kernel::ModelCache

struct ModelCache : public nw::kernel::Service

Public Functions

ModelCache(MemoryResource *scope)
void clear()
model::Mdl *load(StringView resref)
void release(StringView resref)
virtual nlohmann::json stats() const override

Log service stats, if the service wants.

MemoryResource *allocator() const noexcept

Gets the memory allocator for the servce.

inline virtual void initialize(ServiceInitTime)

Initializes a service

Note

Every service will be called with as many values as exist in ServiceInitTime. it’s up to the service itself to filter/ignore what’s not relevant to them.

Public Members

absl::flat_hash_map<String, ModelPayload> map_

Public Static Attributes

static const std::type_index type_index = {typeid(ModelCache)}