TypeManager.h
1/* Copyright (C) 2020-2026 by Marc Boris Duerner
2 SPDX-License-Identifier: LGPL-2.1-or-later WITH mif-exception
3*/
4
5#ifndef PT_LUA_TYPEMANAGER_H
6#define PT_LUA_TYPEMANAGER_H
7
8#include <Pt/Lua/Api.h>
9#include <Pt/Lua/AsyncCall.h>
10#include <Pt/Reflex/TypeManager.h>
11#include <Pt/Reflex/Function.h>
12#include <Pt/Reflex/Type.h>
13
14namespace Pt {
15
16namespace Lua {
17
26template <typename... As>
27using AsyncFunction = Pt::Reflex::BasicFunction<AsyncCall*, As...>;
28
29
50class PT_LUA_API TypeManager : public Pt::Reflex::TypeManager
51{
52 public:
56
57 TypeManager(const TypeManager&) = delete;
58
59 TypeManager& operator=(const TypeManager&) = delete;
60
64
67 Pt::Reflex::Type& voidType() const
68 { return *_voidType; }
69
70 private:
71 Pt::Reflex::BasicType<int>* _intType;
72 Pt::Reflex::BasicType<long>* _longType;
73 Pt::Reflex::BasicType<float>* _floatType;
74 Pt::Reflex::BasicType<double>* _doubleType;
75 Pt::Reflex::BasicType<bool>* _boolType;
76 Pt::Reflex::BasicType<std::string>* _stringType;
77 Pt::Reflex::Type* _voidType;
78 Pt::Reflex::BasicType<AsyncCall*>* _asyncCallType;
79};
80
81} // namespace
82
83} // namespace
84
85#endif // include guard
Asynchronous native call from Lua.
Definition AsyncCall.h:42
TypeManager()
Creates a catalog with Lua builtin types.
~TypeManager()
Destroys the catalog and its builtin types.
Pt::Reflex::Type & voidType() const
Returns the builtin void type.
Definition TypeManager.h:67
Pt::Reflex::BasicFunction< AsyncCall *, As... > AsyncFunction
Reflex function that returns an asynchronous Lua call.
Definition TypeManager.h:27
Lua runtime and reflected bindings.
Core module.
Definition Allocator.h:33