Class ResourceMap

Inheritance Relationships

Derived Type

Class Documentation

class backend::ResourceMap

Subclassed by vi_map::VIMap

Public Types

typedef int ResourceFolderIndex

Public Functions

ResourceMap()
explicit ResourceMap(const std::string &map_folder)
explicit ResourceMap(const metadata::proto::MetaData &metadata_proto)
void deepCopy(const ResourceMap &other)
void mergeFromMap(const ResourceMap &source_map)
void setMetaDataFromProto(const metadata::proto::MetaData &metadata_proto)
void migrateAllResourcesToFolder(const std::string &resource_folder, const bool move_resources)
void migrateAllResourcesToMapResourceFolder(const bool move_resources)
void setMapFolder(const std::string &map_folder)
void setMapFolder(const std::string &map_folder, const bool adapt_resource_references)
void replaceMapFolder(const std::string &new_map_folder)
void getMapFolder(std::string *map_folder) const
const std::string &getMapFolder() const
bool hasMapFolder() const
MetaData getMetaDataCopy() const
void getMapResourceFolder(std::string *default_folder) const
void getExternalResourceFolders(std::vector<std::string> *external_folders) const
void useExternalResourceFolder(const std::string &resource_folder)
void useMapResourceFolder()
void getResourceFolderInUse(std::string *default_folder) const
CacheStatistic getResourceCacheStatisticCopy() const
size_t getNumResourceCacheMiss(const ResourceType &type) const
size_t getNumResourceCacheHits(const ResourceType &type) const
void serializeResourceInfo(resource_info::proto::ResourceInfoMap *resource_info_map_proto) const
void serializeResourceInfo(resource_info::proto::ResourceInfoMap *resource_info_map_proto, const size_t start_idx, const size_t num_resource_infos_to_serialize) const
void deserializeResourceInfo(const resource_info::proto::ResourceInfoMap &resource_info_map_proto)
void serializeMetaData(metadata::proto::MetaData *metadata) const
size_t numResources() const
size_t numResourcesOfType(const ResourceType &type) const
std::string printCacheStatistics() const
void printCacheStatisticsToLog(int verbosity) const
std::string printResourceStatistics() const
void printResourceStatisticsToLog(int verbosity) const
size_t getNumResourcesOfType(const ResourceType &resource_type) const
void cleanupResourceFolders()
bool checkResourceFileSystem() const

Public Static Attributes

static constexpr ResourceFolderIndex kMapResourceFolder = -1
static constexpr ResourceFolderIndex kUnknownResourceFolder = -2

Protected Functions

template<typename DataType>
bool checkResource(const ResourceId &id, const ResourceType &type) const
template<typename DataType>
void addResource(const ResourceType &type, const DataType &resource, ResourceId *id)
template<typename DataType>
void addResource(const ResourceType &type, const DataType &resource, const std::string &folder, ResourceId *id)
template<typename DataType>
void addResource(const ResourceType &type, const DataType &resource, const ResourceId &id)
template<typename DataType>
bool getResource(const ResourceId &id, const ResourceType &type, DataType *resource) const
template<typename DataType>
bool deleteResource(const ResourceId &id, const ResourceType &type)
template<typename DataType>
bool deleteResource(const ResourceId &id, const ResourceType &type, const bool keep_resource_file)
bool deleteResourceNoDataType(const ResourceId &id, const ResourceType &type)
bool deleteResourceNoDataType(const ResourceId &id, const ResourceType &type, const bool keep_resource_file)
template<typename DataType>
bool replaceResource(const ResourceId &id, const ResourceType &type, const DataType &resource)
struct MetaData

Public Functions

MetaData &operator=(const MetaData &other_meta_data)
explicit MetaData(const std::string &map_folder)
explicit MetaData(const metadata::proto::MetaData &metadata_proto)
void serialize(metadata::proto::MetaData *metadata_proto) const

Public Members

std::string map_folder
std::string map_description
ResourceFolderIndex resource_folder_in_use
const std::string kResourceFolderName = "/resources/"
std::string map_resource_folder
std::vector<std::string> external_resource_folders