20 lines
393 B
C++
20 lines
393 B
C++
#ifndef UTIL_OBJECTS_KEEPER_HPP_
|
|
#define UTIL_OBJECTS_KEEPER_HPP_
|
|
|
|
#include <vector>
|
|
#include <memory>
|
|
|
|
namespace util {
|
|
class ObjectsKeeper {
|
|
std::vector<std::shared_ptr<void>> ptrs;
|
|
public:
|
|
virtual ~ObjectsKeeper() {}
|
|
|
|
virtual void keepAlive(std::shared_ptr<void> ptr) {
|
|
ptrs.push_back(ptr);
|
|
}
|
|
};
|
|
}
|
|
|
|
#endif // UTIL_OBJECTS_KEEPER_HPP_
|