#ifndef DATASET_H_
#define DATASET_H_
+#include <vector>
#include <string>
#include <map>
#include <resman.h>
template <typename T>
class DataSet {
+public:
+ typedef void (*LoadedCallbackFunc)(T, void*);
+
protected:
mutable std::map<std::string, T> data;
mutable struct resman *rman;
+ std::vector<std::pair<LoadedCallbackFunc, void*> > loaded_cb;
+
T (*create)();
bool (*load)(T, const char*);
bool (*done)(T);
void update();
T get(const char *name) const;
+
+ void add_loaded_callback(LoadedCallbackFunc func, void *cls = 0);
+ bool remove_loaded_callback(LoadedCallbackFunc func);
};
#include "dataset.inl"