#pragma once #include #include #include #include #include #include namespace theo::recomp { /// /// this class is a high level wrapper for a hashmap that contains /// decomp::symbol_t values. the symbol values are references by a hashcode. /// class symbol_table_t { public: /// /// default constructor. does nothing. /// symbol_table_t() {} /// /// this constructor will populate the m_table private field with symbols. /// /// vector of decomp::symbol_t symbol_table_t(const std::vector&& syms); /// /// add symbol to m_table /// /// symbol to be added. void put_symbol(decomp::symbol_t& sym); /// /// add a vector of symbol to m_table /// /// void put_symbols(std::vector& syms); /// /// returns an optional pointer to a symbol from the symbol table given the symbols hash (hash of its name) /// the hash is produced by theo::decomp::symbol_t::hash /// /// hashcode of the symbol to get from the symbol table... /// returns an optional pointer to a theo::decomp::symbol_t std::optional sym_from_hash(std::size_t hash); /// /// returns an optional pointer to a symbol given its allocation location. /// /// the address where the symbol is allocated at. /// returns an optional pointer to a theo::decomp::symbol_t std::optional sym_from_alloc(std::uintptr_t allocated_at); void for_each(std::function fn); std::uint32_t size(); private: std::map m_table; }; } // namespace theo::recomp