typeMaker.hpp
Go to the documentation of this file.
1
2#pragma once
3
5
6namespace by {
7
11 class _nout typeMaker {
12 BY(ME(typeMaker))
13
14 private:
15 static mgdType _make(void*, const std::string& name, const type& super, const params& ps, nbool isAdt,
16 const node* ret) {
17 return mgdType(name, super, ps, isAdt, ret);
18 }
19
20 static funcMgdType _make(baseFunc*, const std::string& name, const type& super, const params& ps, nbool isAdt,
21 const node* ret) {
22 return funcMgdType(name, super, ps, isAdt, ret);
23 }
24
25 public:
26 template <typename T> static auto make(const params& ps, const node* ret) {
27 return make<T>(ttype<T>::get().getName(), ps, ret);
28 }
29
30 template <typename T> static auto make(const std::string& name) { return make<T>(name, params(), nullptr); }
31
32 template <typename T>
33 static auto make(const std::string& name, const params& ps, const node* ret)
34 -> decltype(_make((T*) nullptr, name, ttype<T>::get(), ps, !std::is_constructible<T>::value, ret)) {
35 return _make((T*) nullptr, name, ttype<T>::get(), ps, !std::is_constructible<T>::value, ret);
36 }
37 };
38}
Base class for all function types.
Definition: baseFunc.hpp:18
Managed type for function objects.
Definition: funcMgdType.hpp:10
Managed type for byeol objects.
Definition: mgdType.hpp:17
Base class for all AST nodes in byeol language.
Definition: node.hpp:30
Function parameter list container.
Definition: params.hpp:15
Template type wrapper for type metadata management.
Definition: ttype.hpp:16
Base class for runtime type information in byeol language.
Definition: type.hpp:12
Factory for creating managed types.
Definition: typeMaker.hpp:11