void InformationManager::signal_new_function(Function* fun) {
}
+
+
+/* *******************************
+ * Accessors for the Functions map
+ */
+
Function* InformationManager::getFunction(uint64_t address) {
auto it = functions.find(address);
if (it != functions.end())
return NULL;
}
+std::map<uint64_t, Function*>::const_iterator InformationManager::beginFunctions() {
+ return functions.begin();
+}
+std::map<uint64_t, Function*>::const_iterator InformationManager::endFunctions() {
+ return functions.end();
+}
+
+
+/* *********************************
+ * Accessors for the BasicBlocks map
+ */
+
BasicBlock* InformationManager::getBasicBlock(uint64_t address) {
auto it = blocks.find(address);
if (it != blocks.end())
return NULL;
}
+std::map<uint64_t, BasicBlock*>::const_iterator InformationManager::beginBasicBlocks() {
+ return blocks.begin();
+}
+std::map<uint64_t, BasicBlock*>::const_iterator InformationManager::endBasicBlocks() {
+ return blocks.end();
+}
+
+
+
+/* ********************************
+ * Factory methods for data classes
+ */
+
Function* InformationManager::newFunction(uint64_t address) {
Function* fun = new Function(address, this);
functions.insert(std::make_pair(address, fun));
class BasicBlock;
class Comment;
+class RenameFunctionEvent;
+
class QString;
class QTemporaryFile;
-class RenameFunctionEvent;
-
class InformationManager {
public:
InformationManager();
void dispatch(RenameFunctionEvent* event)
{ rename_function_signal(event); }
+
Function* getFunction(uint64_t address);
- BasicBlock* getBasicBlock(uint64_t address);
bool hasFunctions() const {return functions.size() != 0;}
+ std::map<uint64_t, Function*>::const_iterator beginFunctions();
+ std::map<uint64_t, Function*>::const_iterator endFunctions();
+
+ BasicBlock* getBasicBlock(uint64_t address);
+ bool hasBasicBlocks() const {return blocks.size() != 0;}
+ std::map<uint64_t, BasicBlock*>::const_iterator beginBasicBlocks();
+ std::map<uint64_t, BasicBlock*>::const_iterator endBasicBlocks();
+
/* Protocoll:
*