#ifndef PERF_HISTORY_HPP_
#define PERF_HISTORY_HPP_

#include <vector>

#include <PerfTimeline/PerfTimeline.hpp>

/**
 * @brief Represents a single performance history, e.g. the frame history.
 */
class PerfHistory
{
private:
    std::vector<PerfTimeline> timelines;
    int currentTimeline = 0;
    int numTimelines;

public:
    static PerfHistory frame;

    /**
     * @brief Construct this history to store the specified number of past timelines.
     */
    PerfHistory(int numTimelines);

    /**
     * @brief Move onto the next timeline.
     * 
     * This must only be called when there are no events in progress.
     */
    void beginTimeline();

    /**
     * @brief Return a const reference to the specified timeline.
     * 
     * @param offset The offset in timeline (0 = current timeline).
     * @return The timeline.
     */
    PerfTimeline& getTimeline(int offset);
};

#endif