#ifndef LIMITEDQUEUESNAPSHOT_H #define LIMITEDQUEUESNAPSHOT_H #include #include namespace chatterino { namespace messages { template class LimitedQueueSnapshot { public: LimitedQueueSnapshot(std::shared_ptr> ptr, int offset, int length) : vector(ptr) , offset(offset) , length(length) { } int getLength() { return this->length; } T const &operator[](int index) const { return this->vector->at(index + this->offset); } private: std::shared_ptr> vector; int offset; int length; }; } } #endif // LIMITEDQUEUESNAPSHOT_H