10#include <detail/literal_string.hpp>
12#include <detail/preprocessor.hpp>
36template <
typename Ctx = DLMethodInvokeContext>
38 virtual int invoke(Ctx* context) LIBER_INTERFACE_ONLY;
44 virtual int arg_count() LIBER_INTERFACE_ONLY;
45 virtual void zero_context1(Ctx* context) LIBER_INTERFACE_ONLY;
46 virtual void zero_context2(Ctx* context) LIBER_INTERFACE_ONLY;
47 virtual char* ref_byte() LIBER_INTERFACE_ONLY;
89 const wchar_t* method_name_w) noexcept
90 : owner(owner), method_name(method_name), method_name_w(method_name_w) {
99 return this->method_name;
108 return this->method_name_w;
118 return this->invokers;
125 const char* method_name;
126 const wchar_t* method_name_w;
129 void* liber_unknown =
nullptr;
151 const wchar_t* name_w) noexcept
152 : object(std::move(method)), name(name), name_w(name_w),
153 length(std::strlen(name)) {}
160 const T*
get() const noexcept {
161 return this->
object.get();
169 const wchar_t* name_w;
225 virtual
char* ref_byte1() = 0;
226 virtual
char* ref_byte2() = 0;
227 virtual
char* ref_byte3() = 0;
228 virtual
char* ref_byte4() = 0;
231 virtual
bool unk_always_false() = 0;
255 const
char* method_name, const
wchar_t* method_name_w);
265 const
char* method_name, const
wchar_t* method_name_w);
273 return this->base_class;
295 return this->runtime_methods;
305 const std::string_view& method_name)
noexcept;
368 return this->_class_name;
371 return this->_class_name_w;
375 char* ref_byte1() LIBER_INTERFACE_OVERRIDE;
376 char* ref_byte2() LIBER_INTERFACE_OVERRIDE;
377 char* ref_byte3() LIBER_INTERFACE_OVERRIDE;
378 char* ref_byte4() LIBER_INTERFACE_OVERRIDE;
380 bool unk_always_false() LIBER_INTERFACE_OVERRIDE;
382 DLKR::DLAllocator*) LIBER_INTERFACE_OVERRIDE;
390 const char* _class_name;
391 const wchar_t* _class_name_w;
400template <
class Impl, liber::literal_
string ImplName>
402 static constexpr auto dl_runtime_class_name = ImplName.trunc();
403 static constexpr auto dl_runtime_class_name_w = ImplName.widen();
413 DLRuntimeClassTemplate::dl_runtime_class_name.string,
414 DLRuntimeClassTemplate::dl_runtime_class_name_w.string
418LIBER_ASSERTS_BEGIN(DLRuntimeMethod);
419LIBER_ASSERT_SIZE(0x70);
420LIBER_ASSERT_OFFS(0x18, invokers);
421LIBER_ASSERT_OFFS(0x60, mutex);
424LIBER_ASSERTS_TEMPLATE_BEGIN(DLRuntimeObjectHolder, DLRuntimeMethod);
425LIBER_ASSERT_SIZE(0x20);
428LIBER_ASSERTS_BEGIN(DLRuntimeClass);
429LIBER_ASSERT_SIZE(0x38);
432LIBER_ASSERTS_TEMPLATE_BEGIN(DLRuntimeClassImpl, liber::dummy);
433LIBER_ASSERT_SIZE(0x48);
A wrapper around a Windows kernel mutex.
Definition kernel_runtime.hpp:106
Layout of a Dantelion2 method invoker interface.
Definition reflection.hpp:37
Concrete DLRuntimeClass reflection for class Impl.
Definition reflection.hpp:350
DLRuntimeClassImpl(const char *class_name, const wchar_t *class_name_w) noexcept
Construct a new DLRuntimeClassImpl object.
Definition reflection.hpp:362
const char * class_name() const noexcept override
Get the name of the type.
Definition reflection.hpp:367
const wchar_t * class_name_w() const noexcept override
Get the name of the type (wide).
Definition reflection.hpp:370
The libER reflection implementation of DLRuntimeClass.
Definition reflection.hpp:401
Type reflection object for an implementing class.
Definition reflection.hpp:199
const from::vector< DLRuntimeMethodHolder > & get_methods() const noexcept
Get every bound method.
Definition reflection.hpp:294
liber::optref< const DLRuntimeMethod > get_constructor() const noexcept
Get the constructor method (if bound)
Definition reflection.hpp:281
virtual LIBERAPI void add_method_invoker(DLMethodInvoker *invoker, const char *method_name, const wchar_t *method_name_w)
Add an invoker to a vector of invokers for a given method.
virtual LIBERAPI void add_constructor_invoker(DLMethodInvoker *invoker, const char *method_name, const wchar_t *method_name_w)
Add an invoker to a vector of invokers for the class's constructor.
LIBERAPI liber::optref< DLRuntimeMethod > find_method(const std::string_view &method_name) noexcept
Find a bound method by name (if it exists).
const DLRuntimeClass * get_base() const noexcept
Get a derived class's base class.
Definition reflection.hpp:272
virtual const wchar_t * class_name_w() const noexcept=0
Get the name of the type (wide).
virtual const char * class_name() const noexcept=0
Get the name of the type.
static LIBERAPI const from::vector< DLRuntimeClassHolder > & get_registered_classes() noexcept
Get a vector of all globally registered DLRuntimeClasses.
virtual size_t class_size() const noexcept=0
Size of the type.
static LIBERAPI const from::vector< DLRuntimeClassPair > & get_runtime_pairs() noexcept
Get a vector of all globally registered DLRuntimeClass pairs.
The main libER stand-in for ER allocator proxies.
Definition from_allocator.hpp:310
from::unique_ptr based on std::unique_ptr
std::unique_ptr< T, from::delay_delete< T, AllocatorTag > > unique_ptr
std::unique_ptr with from::allocator and from::delay_delete.
Definition from_unique_ptr.hpp:22
from::vector based on std::vector
std::vector< T, from::allocator< T, AllocatorTag > > vector
std::vector with from::allocator.
Definition from_vector.hpp:23
Dantelion2 kernel object management and synchronization.
Optional references based on std::optional.
std::pair< char *, DLRuntimeClass * > DLRuntimeClassPair
A pair of a char and a DLRuntimeClass pointers.
Definition reflection.hpp:189
Concrete method invoker, exposition only.
Definition reflection.hpp:60
void * method
The bound method.
Definition reflection.hpp:65
Definition reflection.hpp:29
Definition reflection.hpp:28
Definition reflection.hpp:30
A wrapper that represents a method with a vector of invoker objects.
Definition reflection.hpp:75
const char * get_method_name() const noexcept
Get the method name.
Definition reflection.hpp:98
const from::vector< DLMethodInvoker * > & get_invokers() const noexcept
Get all the invokers bound to this method.
Definition reflection.hpp:117
DLRuntimeMethod(DLRuntimeClass *owner, const char *method_name, const wchar_t *method_name_w) noexcept
Construct a new DLRuntimeMethod object.
Definition reflection.hpp:88
const wchar_t * get_method_name_w() const noexcept
Get the method name (wide)
Definition reflection.hpp:107
A holder for a DLRF::DLRuntime object.
Definition reflection.hpp:140
const T * get() const noexcept
Get a pointer to the held method instance.
Definition reflection.hpp:160
DLRuntimeObjectHolder(from::unique_ptr< T > &&method, const char *name, const wchar_t *name_w) noexcept
Construct a new DLRuntimeObjectHolder object.
Definition reflection.hpp:150
A std::optional<std::reference_wrapper<T>> wrapper for lvalue references.
Definition optref.hpp:31