/* * Copyright 2021, Andrew Lindesay * All rights reserved. Distributed under the terms of the MIT License. */ #ifndef COLLECTOR_H #define COLLECTOR_H #include template class Collector { public: virtual void Add(T value) = 0; }; template class VectorCollector : public Collector { public: VectorCollector(std::vector& target) : fTarget(target) { } virtual void Add(T value) { fTarget.push_back(value); } private: std::vector& fTarget; }; #endif // COLLECTOR_H