libecs-cpp 2.1.0
Entity Component System library in C++
Loading...
Searching...
No Matches
Public Attributes | List of all members
ecs::Resource Struct Reference

A block of bytes that a container stores under a name with Container::ResourceAdd(). More...

#include <Resource.hpp>

Public Attributes

std::vector< uint8_t > Data
 The bytes of the resource.
 

Detailed Description

A block of bytes that a container stores under a name with Container::ResourceAdd().

The container keeps the bytes in one shared, read-only object: Container::ResourceGet() returns a std::shared_ptr<const Resource>, empty for an unknown name, and every holder sees the same bytes without a copy. Pass the bytes to ResourceAdd() with std::move() to avoid copying them. Treat a resource as read-only once it has been added; adding another under the same name replaces it, and holders of the old one keep their data.

Member Data Documentation

◆ Data

std::vector<uint8_t> ecs::Resource::Data

The bytes of the resource.


The documentation for this struct was generated from the following file: