X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fdataset.h;h=5c4ca51905d4813040c777edfaad40460213ae68;hp=a4736c4c6da748af843d9a3db207c845bf592f88;hb=8512530474f0e0827447b6c81302120592f0e297;hpb=59af92c432928d1a325393472cb8ec7a4a1594ad diff --git a/src/dataset.h b/src/dataset.h index a4736c4..5c4ca51 100644 --- a/src/dataset.h +++ b/src/dataset.h @@ -19,16 +19,22 @@ #ifndef DATASET_H_ #define DATASET_H_ +#include #include #include #include template class DataSet { +public: + typedef void (*LoadedCallbackFunc)(T, void*); + protected: mutable std::map data; mutable struct resman *rman; + std::vector > loaded_cb; + T (*create)(); bool (*load)(T, const char*); bool (*done)(T); @@ -46,6 +52,9 @@ public: 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"