2018-06-28 20:25:37 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <pajlada/signals/signal.hpp>
|
|
|
|
|
|
|
|
#include <mutex>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
|
|
|
|
template <typename TValue>
|
2018-06-28 20:27:24 +02:00
|
|
|
class SimpleSignalVector
|
2018-06-28 20:25:37 +02:00
|
|
|
{
|
|
|
|
public:
|
2018-06-28 20:27:24 +02:00
|
|
|
SimpleSignalVector &operator=(std::vector<TValue> &other)
|
2018-06-28 20:25:37 +02:00
|
|
|
{
|
|
|
|
this->data = other;
|
|
|
|
|
|
|
|
this->updated.invoke();
|
|
|
|
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
operator std::vector<TValue> &()
|
|
|
|
{
|
|
|
|
return this->data;
|
|
|
|
}
|
|
|
|
|
|
|
|
pajlada::Signals::NoArgSignal updated;
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::vector<TValue> data;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace chatterino
|