]> git.siccegge.de Git - frida/frida.git/blob - src/core/Function.hxx
Properly add StreamReader class
[frida/frida.git] / src / core / Function.hxx
1 #ifndef INCLUDE__Function_hxx
2 #define INCLUDE__Function_hxx
3
4 #include <map>
5 #include "BasicBlock.hxx"
6
7 class InformationManager;
8 class QXmlStreamWriter;
9 class QXmlStreamReader;
10
11 class Function {
12 public:
13 uint64_t getStartAddress() const { return start_address; }
14
15 std::string getName() const { return name; }
16 void setName(const std::string& new_name);
17
18 InformationManager* getManager() const { return manager; }
19
20 bool isDynamic() const { return dynamic; }
21
22 void addBasicBlock(BasicBlock* block) {
23 _blocks.insert(std::make_pair(block->getStartAddress(), block));
24 }
25
26 const std::map<uint64_t, BasicBlock*>& blocks() {
27 return _blocks;
28 }
29
30 void serialize(QXmlStreamWriter& stream);
31 static Function* deserialize(QXmlStreamReader& stream, InformationManager* manager);
32
33 private:
34 Function(uint64_t start_address, bool dynamic, InformationManager* manager);
35
36 std::string name;
37 uint64_t start_address;
38 bool dynamic;
39 InformationManager * manager;
40 std::map<uint64_t, BasicBlock*> _blocks;
41
42 friend class InformationManager;
43 };
44
45 #endif