]> git.siccegge.de Git - frida/frida.git/blob - src/core/InformationManager.hxx
Make InformationManager responsible for cleaning Blocks / Functions
[frida/frida.git] / src / core / InformationManager.hxx
1 #ifndef INCLUDE__InformationManager_hxx
2 #define INCLUDE__InformationManager_hxx
3
4 #include <boost/signals2.hpp>
5 #include <functional>
6 #include <string>
7 #include <set>
8
9 class Disassembler;
10 class Function;
11 class BasicBlock;
12
13 class QString;
14
15 class InformationManager {
16 public:
17 ~InformationManager();
18
19 void reset(const std::string& filename);
20 void save(const QString& filename);
21
22 void signal_new_function(Function* f);
23
24 boost::signals2::connection
25 connect_new_function_signal(std::function<void(Function*)> f)
26 { return new_function_signal.connect(f); }
27
28
29
30 boost::signals2::connection
31 connect_new_dyn_symbol_signal(std::function<void(const std::string& name)> f)
32 { return new_dyn_symbol_signal.connect(f); }
33
34 void signal_new_dyn_symbol(const std::string& f)
35 { new_dyn_symbol_signal(f); }
36
37 boost::signals2::connection
38 connect_reset_signal(std::function<void ()> f)
39 { return reset_signal.connect(f); }
40
41 Disassembler* getDisassembler()
42 { return disassembler.get(); }
43 private:
44 boost::signals2::signal<void ()> reset_signal;
45 boost::signals2::signal<void (Function*)> new_function_signal;
46 boost::signals2::signal<void (const std::string& name)> new_dyn_symbol_signal;
47 std::unique_ptr<Disassembler> disassembler;
48 std::set<Function*> functions;
49 std::set<BasicBlock*> blocks;
50 };
51
52 #endif /* INCLUDE__InformationManager_hxx */