plugify 1.2.8
Loading...
Searching...
No Matches
method.hpp
1#pragma once
2
3#include <memory>
4#include <span>
5#include <string>
6#include <vector>
7
8#include "plugify/global.h"
9#include "plugify/mem_addr.hpp"
10#include "plugify/signarure.hpp"
11#include "plugify/value_type.hpp"
12
13namespace plugify {
14 class Property;
15
16 // Method Class
17 class PLUGIFY_API Method {
18 public:
19 Method();
20 ~Method();
21 Method(const Method& other);
22 Method(Method&& other) noexcept;
23 Method& operator=(const Method& other);
24 Method& operator=(Method&& other) noexcept;
25
26 // Getters
27 [[nodiscard]] const std::inplace_vector<Property, Signature::kMaxFuncArgs>& GetParamTypes() const noexcept;
28 [[nodiscard]] const Property& GetRetType() const noexcept;
29 [[nodiscard]] const std::string& GetName() const noexcept;
30 [[nodiscard]] const std::string& GetFuncName() const noexcept;
31 [[nodiscard]] CallConv GetCallConv() const noexcept;
32 [[nodiscard]] uint8_t GetVarIndex() const noexcept;
33
34 // Setters (pass by value and move)
35 void SetParamTypes(std::inplace_vector<Property, Signature::kMaxFuncArgs> paramTypes);
36 void SetRetType(Property retType);
37 void SetName(std::string name);
38 void SetFuncName(std::string funcName);
39 void SetCallConv(CallConv callConv);
40 void SetVarIndex(uint8_t varIndex);
41
42 [[nodiscard]] bool operator==(const Method& other) const noexcept;
43 [[nodiscard]] auto operator<=>(const Method& other) const noexcept;
44
45 [[nodiscard]] const Method* FindPrototype(std::string_view name) const noexcept;
46
47 PLUGIFY_ACCESS : struct Impl;
48 PLUGIFY_NO_DLL_EXPORT_WARNING(std::unique_ptr<Impl> _impl;)
49 };
50
59 struct MethodData {
60 const Method& method;
62 };
63
71 struct MethodTable {
72 bool hasUpdate{};
73 bool hasStart{};
74 bool hasEnd{};
75 bool hasExport{};
76 };
77}
A wrapper class for memory addresses, providing utility functions for pointer manipulation.
Definition mem_addr.hpp:12
Represents data related to a plugin method.
Definition method.hpp:59
const Method & method
Ref to representing the method.
Definition method.hpp:60
MemAddr addr
Pointer to the method's memory address.
Definition method.hpp:61
Represents a table of method availability flags.
Definition method.hpp:71
bool hasUpdate
Boolean indicating if an update method exists.
Definition method.hpp:72
bool hasExport
Boolean indicating if a export methods exists.
Definition method.hpp:75
bool hasEnd
Boolean indicating if an end method exists.
Definition method.hpp:74
bool hasStart
Boolean indicating if a start method exists.
Definition method.hpp:73