You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Theodosius/include/comp/comp.hpp

30 lines
894 B

#pragma once
#include <comp/symbol_table.hpp>
#include <decomp/decomp.hpp>
namespace theo::comp {
using resolve_t = std::function<std::uintptr_t(std::string&&)>;
using copy_t = std::function<void(void*, std::uint32_t)>;
using alloc_t = std::function<std::uintptr_t(std::uint32_t,
coff::section_characteristics_t)>;
class comp_t {
public:
explicit comp_t(decomp::decomp_t& dcmp, comp::symbol_table_t syms);
explicit comp_t(decomp::decomp_t& dcmp,
comp::symbol_table_t syms,
alloc_t alloc,
copy_t copy,
resolve_t resolve);
void allocator(alloc_t alloc);
void copier(copy_t copy);
void resolver(resolve_t resolve);
std::uintptr_t resolve(std::string&& sym);
private:
resolve_t m_resolver;
copy_t m_copier;
alloc_t m_allocator;
};
} // namespace theo::comp