45 #ifndef __CU_JSON_LOADER_H__
46 #define __CU_JSON_LOADER_H__
47 #include <cugl/assets/CULoader.h>
48 #include <cugl/assets/CUJsonValue.h>
82 void materialize(
const std::string& key,
const std::shared_ptr<JsonValue>& json,
102 virtual bool read(
const std::string& key,
const std::string& source,
125 virtual bool read(
const std::shared_ptr<JsonValue>& json,
130 #pragma mark Constructors
165 static std::shared_ptr<JsonLoader>
alloc() {
166 std::shared_ptr<JsonLoader> result = std::make_shared<JsonLoader>();
167 return (result->init() ? result :
nullptr);
183 static std::shared_ptr<JsonLoader>
alloc(
const std::shared_ptr<ThreadPool>& threads) {
184 std::shared_ptr<JsonLoader> result = std::make_shared<JsonLoader>();
185 return (result->init(threads) ? result :
nullptr);
void materialize(const std::string &key, const std::shared_ptr< JsonValue > &json, LoaderCallback callback)
std::shared_ptr< ThreadPool > _loader
Definition: CULoader.h:102
static std::shared_ptr< JsonLoader > alloc(const std::shared_ptr< ThreadPool > &threads)
Definition: CUJsonLoader.h:183
JsonLoader()
Definition: CUJsonLoader.h:137
virtual bool read(const std::string &key, const std::string &source, LoaderCallback callback, bool async) override
Definition: CUJsonLoader.h:63
std::unordered_map< std::string, std::shared_ptr< JsonValue > > _assets
Definition: CULoader.h:678
std::function< void(const std::string &key, bool success)> LoaderCallback
Definition: CULoader.h:81
static std::shared_ptr< JsonLoader > alloc()
Definition: CUJsonLoader.h:165
Definition: CULoader.h:675
void dispose() override
Definition: CUJsonLoader.h:149
Definition: CUAnimationNode.h:52