Honeycomb  0.1
Component-Model Framework
Module.h
Go to the documentation of this file.
1 // Honeycomb, Copyright (C) 2015 NewGamePlus Inc. Distributed under the Boost Software License v1.0.
2 #pragma once
3 
4 #include "Honey/Thread/DepTask.h"
5 
6 namespace honey
7 {
9 namespace app
10 {
11 
13 struct Module : SharedObj<Module>
14 {
16 
17  Module( const Id& id, const function<void ()>& f,
18  const vector<Id>& outDeps = {}, const vector<Id>& inDeps = {});
19 
21 };
22 
24 
33 {
35  static mt_global(ModuleRegistry, inst,);
36 
38  mt::Void reg(const Module::Ptr& module);
39 
40  unordered_map<Id, Module::Ptr> modules;
41 };
42 
43 } }
Combined intrusive/non-intrusive smart pointer. Can reference and share any object automatically...
Definition: SharedPtr.h:175
Reference-counted object for intrusive shared pointers.
Definition: SharedPtr.h:93
mt::Void reg(const Module::Ptr &module)
Register a module.
Definition: Module.cpp:19
Special void type, use where void is intended but implicit members are required (default ctor...
Definition: Meta.h:37
Module(const Id &id, const function< void()> &f, const vector< Id > &outDeps={}, const vector< Id > &inDeps={})
Definition: Module.cpp:10
static mt_global(ModuleRegistry, inst,)
Get singleton.
An application module, holds a task and its dependencies.
Definition: Module.h:13
List of application modules.
Definition: Module.h:32
SharedPtr< Module > Ptr
Definition: Module.h:15
Holds a name string and its hashed value for fast comparison ops. See String Identifier.
Definition: Id.h:25
DepTask_< void >::Ptr task
Definition: Module.h:20
Global Honeycomb namespace.
unordered_map< Id, Module::Ptr > modules
Definition: Module.h:40
Holds a functor and dependency information, enqueue in a scheduler to run the task.
Definition: DepTask.h:107