1 #ifndef INCLUDE__Function_hxx
2 #define INCLUDE__Function_hxx
5 #include "BasicBlock.hxx"
7 class InformationManager;
8 class QXmlStreamWriter;
9 class QXmlStreamReader;
13 uint64_t getStartAddress() const { return start_address; }
15 std::string getName() const { return name; }
16 void setName(const std::string& new_name);
18 InformationManager* getManager() const { return manager; }
20 /* Dynamic functions are the ones which are imported from shared
21 * libraries and not structly part of the binary at hand
23 bool isDynamic() const { return dynamic; }
25 void addBasicBlock(BasicBlock* block) {
26 _blocks.insert(std::make_pair(block->getStartAddress(), block));
29 const std::map<uint64_t, BasicBlock*>& blocks() {
33 void serialize(QXmlStreamWriter& stream);
34 static Function* deserialize(QXmlStreamReader& stream, InformationManager* manager);
37 Function(uint64_t start_address, bool dynamic, InformationManager* manager);
40 uint64_t start_address;
42 InformationManager * manager;
43 std::map<uint64_t, BasicBlock*> _blocks;
45 friend class InformationManager;