i2pd/qt/i2pd_qt/widgetlockregistry.h
2017-09-08 15:59:19 +08:00

28 lines
568 B
C++

#ifndef WIDGETLOCKREGISTRY_H
#define WIDGETLOCKREGISTRY_H
#include <vector>
#include <widgetlock.h>
class widgetlockregistry {
std::vector<widgetlock*> locks;
public:
widgetlockregistry() : locks() {}
virtual ~widgetlockregistry() {}
void add(widgetlock* lock) {
locks.push_back(lock);
}
void deleteListeners() {
while(!locks.empty()) {
widgetlock* lock = locks.back();
lock->deleteListener();
delete lock;
locks.pop_back();
}
}
};
#endif // WIDGETLOCKREGISTRY_H