aboutsummaryrefslogtreecommitdiff
path: root/src/lindafactory.h
blob: ac42c10beb68721b993bd7c2135fcce7fe45c66b (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
#pragma once

#include "deep.hpp"

// #################################################################################################

class LindaFactory
: public DeepFactory
{
    public:
    // I'm not totally happy with having a 'global' variable. Maybe it should be dynamically created and stored somewhere in the universe?
    static LindaFactory Instance;

    LindaFactory(luaL_Reg const lindaMT_[])
    : mLindaMT{ lindaMT_ }
    {
    }

    private:
    luaL_Reg const* const mLindaMT{ nullptr };

    void createMetatable(lua_State* L_) const override;
    void deleteDeepObjectInternal(lua_State* L_, DeepPrelude* o_) const override;
    [[nodiscard]] std::string_view moduleName() const override;
    [[nodiscard]] DeepPrelude* newDeepObjectInternal(lua_State* L_) const override;
};