projects
/
laserbrain_demo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
debug gui select/hide nodes
[laserbrain_demo]
/
src
/
dataset.h
diff --git
a/src/dataset.h
b/src/dataset.h
index
a4736c4
..
5c4ca51
100644
(file)
--- a/
src/dataset.h
+++ b/
src/dataset.h
@@
-19,16
+19,22
@@
#ifndef DATASET_H_
#define DATASET_H_
#ifndef DATASET_H_
#define DATASET_H_
+#include <vector>
#include <string>
#include <map>
#include <resman.h>
template <typename T>
class DataSet {
#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;
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);
T (*create)();
bool (*load)(T, const char*);
bool (*done)(T);
@@
-46,6
+52,9
@@
public:
void update();
T get(const char *name) const;
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"
};
#include "dataset.inl"