2. Which design pattern is used in the following code?

#include <cassert>
#include <string>

class MacroAction
{
public:
    virtual void execute() = 0;
    virtual ~MacroAction() { }
};

class FindAction
    : public MacroAction
{
public:
    FindAction(const std::string &text, const std::string &word,
               size_t &position)
        : m_text(text)
        , m_word(word)
        , m_position(position)
    {
        assert(position <= text.size());
        assert(!word.empty());
    }

    void execute()
    {
        assert(m_position <= m_text.size());
        assert(!m_word.empty());

        const size_t n = m_text.find(m_word, m_position);
        m_position = (n < m_text.size()) ? n : m_text.size();
    }

private:
    const std::string &m_text;
    const std::string &m_word;
    size_t &m_position;
};

class MoveByAction
    : public MacroAction
{
public:
    MoveByAction(const std::string &text, size_t &position, int offset)
        : m_text(text)
        , m_position(position)
        , m_offset(offset)
    {
        assert(position <= text.size());
    }

    void execute()
    {
        assert(m_position <= m_text.size());

        const int r = static_cast<int>(m_position) + m_offset;
        if (r < 0) {
            m_position = 0;
        }
        else {
            const size_t n = static_cast<size_t>(r);
            m_position = (n < m_text.size()) ? n : m_text.size();
        }
    }

private:
    const std::string &m_text;
    size_t &m_position;
    int m_offset;
};

class DeleteAction
    : public MacroAction
{
public:
    DeleteAction(std::string &text, size_t position, size_t count)
        : m_text(text)
        , m_position(position)
        , m_count(count)
    {
        assert(position <= text.size());
    }

    void execute()
    {
        assert(m_position <= m_text.size());

        m_text.erase(m_position, m_count);
    }

private:
    std::string &m_text;
    const size_t m_position;
    const size_t m_count;
};