Bomberman
Public Member Functions | Private Attributes | List of all members
RAY::Cache<::Shader > Class Reference

#include <Cache.hpp>

Collaboration diagram for RAY::Cache<::Shader >:

Public Member Functions

 Cache (std::function<::Shader(const char *, const char *)> dataLoader, std::function< void(::Shader)> dataUnloader)
 
std::shared_ptr<::Shaderfetch (const std::string &vertexFile, const std::string &fragmentFile, bool lonely=false)
 

Private Attributes

std::function<::Shader(const char *, const char *)> _dataLoader
 function to call to load data More...
 
std::function< void(::Shader)> _dataUnloader
 function to call when the ray data will be unloaded More...
 
std::unordered_map< std::string, std::vector< std::shared_ptr<::Shader > > > _cache
 map storing shared ptr of caches More...
 

Constructor & Destructor Documentation

◆ Cache()

RAY::Cache<::Shader >::Cache ( std::function<::Shader(const char *, const char *)>  dataLoader,
std::function< void(::Shader)>  dataUnloader 
)
inline

Member Function Documentation

◆ fetch()

std::shared_ptr<::Shader> RAY::Cache<::Shader >::fetch ( const std::string &  vertexFile,
const std::string &  fragmentFile,
bool  lonely = false 
)
inline

Member Data Documentation

◆ _cache

std::unordered_map<std::string, std::vector<std::shared_ptr<::Shader> > > RAY::Cache<::Shader >::_cache
private

map storing shared ptr of caches

◆ _dataLoader

std::function<::Shader(const char *, const char *)> RAY::Cache<::Shader >::_dataLoader
private

function to call to load data

◆ _dataUnloader

std::function<void(::Shader)> RAY::Cache<::Shader >::_dataUnloader
private

function to call when the ray data will be unloaded


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