#pragma once

#include "List.h"
#include "AbstractGrid.h"

#include <memory>

template <typename T>
class TypedGrid : public AbstractGrid
{
public:
    TypedGrid(const Bounds& bounds, std::size_t numPointsX, std::size_t numPointsY, std::size_t numPointsZ = 1)
        : AbstractGrid(bounds, numPointsX, numPointsY, numPointsZ),
            mData(std::make_unique<List<T> >())
    {
    }

    virtual ~TypedGrid() = default;

    virtual T getItem(std::size_t idx, std::size_t jdx, std::size_t kdx) const = 0;

    virtual void setItem(std::size_t idx, std::size_t jdx, std::size_t kdx, const T& value) = 0;

    List<T>* getInternalData() const
    {
        return mData.get();
    }
protected:
    std::unique_ptr<List<T> > mData;
};
