-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdependencygraphdefault.hpp
48 lines (39 loc) · 1.31 KB
/
dependencygraphdefault.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//@ {
//@ "targets":[{"name":"dependencygraphdefault.hpp","type":"include"}]
//@ ,"dependencies_extra":[{"ref":"dependencygraphdefault.o","rel":"implementation"}]
//@ }
#ifndef MAIKE_DEPENDENCYGRAPHDEFAULT_HPP
#define MAIKE_DEPENDENCYGRAPHDEFAULT_HPP
#include "dependencygraph.hpp"
#include "stringkey.hpp"
#include "handle.hpp"
#include "twins.hpp"
#include "idgenerator.hpp"
#include <map>
namespace Maike
{
class PRIVATE DependencyGraphDefault final:public DependencyGraph
{
public:
explicit DependencyGraphDefault(EventHandler& handler):
r_handler(handler),m_patch_needed(0)
{}
DependencyGraphDefault& targetRegister(Handle<Target>&& target);
DependencyGraphDefault& targetsPatch();
void targetsProcess(TargetProcessorConst&& proc) const;
DependencyGraphDefault& targetsProcess(TargetProcessor&& proc);
DependencyGraphDefault& targetsRemove(TargetProcessor&& condition);
Target* targetFind(const Stringkey& key);
const Target* targetFind(const Stringkey& key) const;
const Twins<size_t>& idRangeGet() const;
DependencyGraphDefault& clear() noexcept;
size_t targetsCountGet() const noexcept
{return m_targets.size();}
private:
EventHandler& r_handler;
std::map< Stringkey,Handle<Target> > m_targets;
Twins<size_t> m_id_range;
bool m_patch_needed;
};
}
#endif