VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
ModuleSymbols.hpp
Go to the documentation of this file.
1#pragma once
2
5
7#include <map>
8#include <string>
9#include <tuple>
10#include <utility>
11
12namespace VoltMod
13{
14
15/** Loaded modules, class vtables and base subobjects, each looked up once. */
17{
18public:
19 /** NotFound naming the module when it is not loaded. */
20 Result<const Image*> Module(const std::string& moduleName);
21
22 /** @p className's primary vtable, or with @p baseName that base's own table inside it. */
23 Result<void*> Table(const std::string& moduleName, const std::string& className, const std::string& baseName = {});
24
25 Result<BaseSubobject> Base(const std::string& moduleName, const std::string& className,
26 const std::string& baseName);
27
28private:
29 std::map<std::string, Image> _modules;
30 std::map<std::pair<std::string, std::string>, void*> _tables;
31 std::map<std::tuple<std::string, std::string, std::string>, Result<BaseSubobject>> _bases;
32};
33
34} // namespace VoltMod
Result< BaseSubobject > Base(const std::string &moduleName, const std::string &className, const std::string &baseName)
Result< void * > Table(const std::string &moduleName, const std::string &className, const std::string &baseName={})
Result< const Image * > Module(const std::string &moduleName)
static std::string ReadFile(const std::filesystem::path &path)
Definition Loader.cpp:56
std::expected< T, Error > Result
Definition Result.hpp:64