summaryrefslogtreecommitdiff
path: root/src/layout/algorithm/TiledAlgorithm.hpp
blob: 6905ac747e935f8e7afad2a82bda341e9ba8ca01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#pragma once

#include "../../helpers/math/Math.hpp"
#include "../../helpers/memory/Memory.hpp"

#include "ModeAlgorithm.hpp"

#include <optional>
#include <string>

namespace Layout {

    class ITarget;
    class CAlgorithm;

    class ITiledAlgorithm : public IModeAlgorithm {
      public:
        virtual ~ITiledAlgorithm() = default;

        virtual SP<ITarget> getNextCandidate(SP<ITarget> old) = 0;

        // Optional runtime layout name. Useful for generic adapter classes where
        // typeid alone cannot identify the selected layout instance.
        virtual std::optional<std::string> layoutName() const {
            return std::nullopt;
        }

      protected:
        ITiledAlgorithm() = default;

        WP<CAlgorithm> m_parent;

        friend class Layout::CAlgorithm;
    };
}