X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fdataset.inl;h=41277a1d9ff7cc93eb3b59f54136a56911e10639;hp=ca01ea2d3336d450e74f7e960bc749e9ebb464b6;hb=0d27f859021b4af5dbb5404ef5af012546abf335;hpb=12e70d8b9c2d5c81500d7631b9db5d17a34fe918 diff --git a/src/dataset.inl b/src/dataset.inl index ca01ea2..41277a1 100644 --- a/src/dataset.inl +++ b/src/dataset.inl @@ -47,10 +47,44 @@ T DataSet::get(const char *name) const T res = create(); data[name] = res; - resman_lookup(rman, name, res); + resman_add(rman, name, res); return res; } +template +int DataSet::pending() const +{ + return resman_pending(rman); +} + +template +void DataSet::wait() const +{ + resman_waitall(rman); +} + +template +void DataSet::add_loaded_callback(LoadedCallbackFunc func, void *cls) +{ + std::pair cb; + cb.first = func; + cb.second = cls; + loaded_cb.push_back(cb); +} + +template +bool DataSet::remove_loaded_callback(LoadedCallbackFunc func) +{ + int numcb = (int)loaded_cb.size(); + for(int i=0; i::dataset_done_func(int id, void *cls) if(dset->done) { dset->done(data); } + + int numcb = (int)dset->loaded_cb.size(); + for(int i=0; iloaded_cb[i].first(data, dset->loaded_cb[i].second); + } return 0; }