An easy way to make the manager globally accessible is to create a singleton:
using TaskProperties = rg::TaskProperties< /*...*/ >;
static auto & mgr()
{
static rg::Manager<
TaskProperties,
rg::ResourceEnqueuePolicy,
MyScheduler
> m;
return m;
}
void foo()
{
mgr().emplace_task( []{ /* ... */ } );
}
use shared_ptr
always use auto
If you implement a structure which should be used as resource, then just derive from the corresponding resource type:
struct MyContainer : rg::IOResource {
// ...
}
TODO: Access Guards