X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fcore%2FInformationManager.hxx;h=2f70d7365d7a27353ffc6ce843f47f99fae832f4;hp=bb37a1e9a69ee9965b82a031b4e8d7bb9853d3f8;hb=057e0e59829f19ee4d9a550f2d3dc9fe9df5c92c;hpb=546b89382dd61b664c216ad7668ec783f0ad094c diff --git a/src/core/InformationManager.hxx b/src/core/InformationManager.hxx index bb37a1e..2f70d73 100644 --- a/src/core/InformationManager.hxx +++ b/src/core/InformationManager.hxx @@ -2,12 +2,13 @@ #define INCLUDE__InformationManager_hxx #include -#include #include #include #include #include +#include +#include "qt.hxx" #include "disassembler/Disassembler.hxx" class Interpreter; @@ -24,9 +25,17 @@ class QString; class QTemporaryFile; class QPluginLoader; -using boost::signals2::connection; - -class InformationManager { +class InformationManager : public QObject { +#ifndef SWIG + Q_OBJECT +signals: +#else +public: +#endif + void renameFunctionEvent(RenameFunctionEvent* event); + void newFunctionEvent(NewFunctionEvent* event); + void changeCommentEvent(ChangeCommentEvent* event); + void reset(); public: InformationManager(); ~InformationManager(); @@ -38,30 +47,7 @@ public: Disassembler* getDisassembler() { return disassembler.get(); } - // Rename Function - typedef std::function RenameFunctionHandler; - connection registerRenameFunctionEvent(RenameFunctionHandler h) - { return renameFunctionSignal.connect(h); } - void dispatch(RenameFunctionEvent* event) - { renameFunctionSignal(event); } - - // New Function - typedef std::function NewFunctionHandler; - connection registerNewFunctionEvent(NewFunctionHandler h) - { return newFunctionSignal.connect(h); } - void dispatch(NewFunctionEvent* event) - { newFunctionSignal(event); } - - // Change Comment - typedef std::function ChangeCommentHandler; - connection registerChangeCommentEvent(ChangeCommentHandler h) - { return changeCommentSignal.connect(h); } - void dispatch(ChangeCommentEvent* event) - { changeCommentSignal(event); } - - connection connect_reset_signal(std::function f) - { return reset_signal.connect(f); } - + // Accessors Function* getFunction(uint64_t address); bool hasFunctions() const {return functions.size() != 0;} std::map::const_iterator beginFunctions(); @@ -72,12 +58,19 @@ public: std::map::const_iterator beginBasicBlocks(); std::map::const_iterator endBasicBlocks(); + std::pair< + std::multimap::const_iterator, + std::multimap::const_iterator> + getComments(uint64_t address); + bool hasComments() const {return ! comments.empty();} + std::multimap::const_iterator beginComments(); + std::multimap::const_iterator endComments(); + Interpreter* getInterpreter(const std::string& name); bool hasInterpreters() const {return interpreters.size() != 0;} std::map::const_iterator beginInterpreters(); std::map::const_iterator endInterpreters(); - /* Protocoll: * * Users may allocate new Data containers with the new*() @@ -104,18 +97,12 @@ public: Comment* newLocalComment(uint64_t address, Function* f); void finishFunction(Function* f); void finishBasicBlock(BasicBlock* b); - void finnishComment(Comment* c); + void finishComment(Comment* c); void deleteFunction(Function* f); void deleteBasicBlock(BasicBlock* b); void deleteComment(Comment* c); private: - boost::signals2::signal renameFunctionSignal; - boost::signals2::signal newFunctionSignal; - boost::signals2::signal changeCommentSignal; - - boost::signals2::signal reset_signal; - std::unique_ptr disassembler; std::map interpreters;