Debugger stuff. Lots of wasted work :/

This commit is contained in:
Ben Vanik
2015-07-26 22:47:03 -07:00
parent 42ef3f224a
commit 7ecc6362de
52 changed files with 3476 additions and 172 deletions

View File

@@ -45,6 +45,33 @@ class Delegate {
std::vector<Listener> listeners_;
};
template <>
class Delegate<void> {
public:
typedef std::function<void()> Listener;
void AddListener(Listener const& listener) {
std::lock_guard<std::mutex> guard(lock_);
listeners_.push_back(listener);
}
void RemoveAllListeners() {
std::lock_guard<std::mutex> guard(lock_);
listeners_.clear();
}
void operator()() {
std::lock_guard<std::mutex> guard(lock_);
for (auto& listener : listeners_) {
listener();
}
}
private:
std::mutex lock_;
std::vector<Listener> listeners_;
};
} // namespace xe
#endif // XENIA_BASE_DELEGATE_H_