#include "BasicBlock.hxx"
class InformationManager;
+class QXmlStreamWriter;
class Function {
public:
- Function(const std::string& name, uint64_t start_address,
- InformationManager* manager)
- : name(name)
- , start_address(start_address)
- ,manager(manager) {}
-
uint64_t getStartAddress() const {
return start_address;
}
std::string getName() const
{ return name; }
- void setName(const std::string& new_name)
- { name = new_name; }
+ void setName(const std::string& new_name);
InformationManager* getManager() const {
return manager;
_blocks.insert(std::make_pair(block->getStartAddress(), block));
}
- std::map<uint64_t, BasicBlock*>& blocks() {
+ const std::map<uint64_t, BasicBlock*>& blocks() {
return _blocks;
}
+
+ void serialize(QXmlStreamWriter& stream);
+ static Function* deserialize(QXmlStreamReader& stream, InformationManager* manager);
+
private:
+ Function(uint64_t start_address, InformationManager* manager);
+
std::string name;
uint64_t start_address;
InformationManager * manager;
std::map<uint64_t, BasicBlock*> _blocks;
+
+ friend class InformationManager;
};
#endif