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/doxygen/latex/d0/d5e/symbol__table_8hpp_source.tex

112 lines
15 KiB

\hypertarget{symbol__table_8hpp_source}{}\doxysection{symbol\+\_\+table.\+hpp}
\label{symbol__table_8hpp_source}\index{include/recomp/symbol\_table.hpp@{include/recomp/symbol\_table.hpp}}
\mbox{\hyperlink{symbol__table_8hpp}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00001}00001 \textcolor{comment}{// Copyright (c) 2022, \_xeroxz}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00002}00002 \textcolor{comment}{// All rights reserved.}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00003}00003 \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00004}00004 \textcolor{comment}{// Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00005}00005 \textcolor{comment}{// modification, are permitted provided that the following conditions are met:}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00006}00006 \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00007}00007 \textcolor{comment}{// 1. Redistributions of source code must retain the above copyright notice,}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00008}00008 \textcolor{comment}{// this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00009}00009 \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00010}00010 \textcolor{comment}{// 2. Redistributions in binary form must reproduce the above copyright notice,}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00011}00011 \textcolor{comment}{// this list of conditions and the following disclaimer in the documentation}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00012}00012 \textcolor{comment}{// and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00013}00013 \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00014}00014 \textcolor{comment}{// 3. Neither the name of the copyright holder nor the names of its}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00015}00015 \textcolor{comment}{// contributors may be used to endorse or promote products derived from}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00016}00016 \textcolor{comment}{// this software without specific prior written permission.}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00017}00017 \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00018}00018 \textcolor{comment}{// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "{}AS IS"{}}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00019}00019 \textcolor{comment}{// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00020}00020 \textcolor{comment}{// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00021}00021 \textcolor{comment}{// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00022}00022 \textcolor{comment}{// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00023}00023 \textcolor{comment}{// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00024}00024 \textcolor{comment}{// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00025}00025 \textcolor{comment}{// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00026}00026 \textcolor{comment}{// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00027}00027 \textcolor{comment}{// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00028}00028 \textcolor{comment}{// POSSIBILITY OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00029}00029 \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00030}00030 }
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00031}00031 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00032}00032 \textcolor{preprocessor}{\#include <algorithm>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00033}00033 \textcolor{preprocessor}{\#include <functional>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00034}00034 \textcolor{preprocessor}{\#include <map>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00035}00035 \textcolor{preprocessor}{\#include <optional>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00036}00036 \textcolor{preprocessor}{\#include <vector>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00037}00037 }
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00038}00038 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{symbol_8hpp}{decomp/symbol.hpp}}>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00039}00039 }
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00040}00040 \textcolor{keyword}{namespace }\mbox{\hyperlink{namespacetheo_1_1recomp}{theo::recomp}} \{\textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00041}00041 \textcolor{comment}{/// <summary>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00042}00042 \textcolor{comment}{/// this class is a high level wrapper for a hashmap that contains}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00043}00043 \textcolor{comment}{/// decomp::symbol\_t values. the symbol values are references by a hashcode.}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00044}00044 \textcolor{comment}{/// </summary>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00045}\mbox{\hyperlink{classtheo_1_1recomp_1_1symbol__table__t}{00045}} \textcolor{comment}{}\textcolor{keyword}{class }\mbox{\hyperlink{classtheo_1_1recomp_1_1symbol__table__t}{symbol\_table\_t}} \{}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00046}00046 \textcolor{keyword}{public}:\textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00047}00047 \textcolor{comment}{ /// <summary>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00048}00048 \textcolor{comment}{ /// default constructor. does nothing.}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00049}00049 \textcolor{comment}{ /// </summary>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00050}\mbox{\hyperlink{classtheo_1_1recomp_1_1symbol__table__t_ad06d4004c0cb454b1ffe7e2ae2ccedf5}{00050}} \textcolor{comment}{} \mbox{\hyperlink{classtheo_1_1recomp_1_1symbol__table__t_ad06d4004c0cb454b1ffe7e2ae2ccedf5}{symbol\_table\_t}}() \{\}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00051}00051 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00052}00052 \textcolor{comment}{ /// <summary>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00053}00053 \textcolor{comment}{ /// this constructor will populate the m\_table private field with symbols.}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00054}00054 \textcolor{comment}{ /// </summary>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00055}00055 \textcolor{comment}{ /// <param name="{}syms"{}>vector of decomp::symbol\_t</param>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00056}00056 \textcolor{comment}{} \mbox{\hyperlink{classtheo_1_1recomp_1_1symbol__table__t_ad06d4004c0cb454b1ffe7e2ae2ccedf5}{symbol\_table\_t}}(\textcolor{keyword}{const} std::vector<decomp::symbol\_t>\&\& syms);}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00057}00057 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00058}00058 \textcolor{comment}{ /// <summary>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00059}00059 \textcolor{comment}{ /// add symbol to m\_table}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00060}00060 \textcolor{comment}{ /// </summary>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00061}00061 \textcolor{comment}{ /// <param name="{}sym"{}>symbol to be added.</param>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00062}00062 \textcolor{comment}{} \textcolor{keywordtype}{void} \mbox{\hyperlink{classtheo_1_1recomp_1_1symbol__table__t_af9caf2d4d97b2498aa624c3750a7a601}{put\_symbol}}(\mbox{\hyperlink{classtheo_1_1decomp_1_1symbol__t}{decomp::symbol\_t}}\& sym);}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00063}00063 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00064}00064 \textcolor{comment}{ /// <summary>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00065}00065 \textcolor{comment}{ /// add a vector of symbol to m\_table}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00066}00066 \textcolor{comment}{ /// </summary>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00067}00067 \textcolor{comment}{ /// <param name="{}syms"{}></param>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00068}00068 \textcolor{comment}{} \textcolor{keywordtype}{void} \mbox{\hyperlink{classtheo_1_1recomp_1_1symbol__table__t_ae7c35d9336f67d3175910c028e0b9b3e}{put\_symbols}}(std::vector<decomp::symbol\_t>\& syms);}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00069}00069 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00070}00070 \textcolor{comment}{ /// <summary>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00071}00071 \textcolor{comment}{ /// returns an optional pointer to a symbol from the symbol table given the}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00072}00072 \textcolor{comment}{ /// symbols hash (hash of its name) the hash is produced by}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00073}00073 \textcolor{comment}{ /// theo::decomp::symbol\_t::hash}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00074}00074 \textcolor{comment}{ /// </summary>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00075}00075 \textcolor{comment}{ /// <param name="{}hash"{}>hashcode of the symbol to get from the symbol}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00076}00076 \textcolor{comment}{ /// table...</param> <returns>returns an optional pointer to a}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00077}00077 \textcolor{comment}{ /// theo::decomp::symbol\_t</returns>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00078}00078 \textcolor{comment}{} std::optional<decomp::symbol\_t*> \mbox{\hyperlink{classtheo_1_1recomp_1_1symbol__table__t_a308c0dbcc4d569467e0986b32ef30db5}{sym\_from\_hash}}(std::size\_t hash);}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00079}00079 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00080}00080 \textcolor{comment}{ /// <summary>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00081}00081 \textcolor{comment}{ /// returns an optional pointer to a symbol given its allocation location.}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00082}00082 \textcolor{comment}{ /// </summary>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00083}00083 \textcolor{comment}{ /// <param name="{}allocated\_at"{}>the address where the symbol is allocated}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00084}00084 \textcolor{comment}{ /// at.</param> <returns>returns an optional pointer to a}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00085}00085 \textcolor{comment}{ /// theo::decomp::symbol\_t</returns>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00086}00086 \textcolor{comment}{} std::optional<decomp::symbol\_t*> \mbox{\hyperlink{classtheo_1_1recomp_1_1symbol__table__t_abaea9fd899d87b09d60c2b815624e2d2}{sym\_from\_alloc}}(std::uintptr\_t allocated\_at);}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00087}00087 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00088}00088 \textcolor{comment}{ /// <summary>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00089}00089 \textcolor{comment}{ /// this function is a wrapper function that allows you to get at each entry}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00090}00090 \textcolor{comment}{ /// in the symbol table by reference.}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00091}00091 \textcolor{comment}{ /// </summary>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00092}00092 \textcolor{comment}{ /// <param name="{}fn"{}>a callback function that will be called for each}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00093}00093 \textcolor{comment}{ /// symbol</param>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00094}00094 \textcolor{comment}{} \textcolor{keywordtype}{void} \mbox{\hyperlink{classtheo_1_1recomp_1_1symbol__table__t_a35008ba37814a94209cf979302e13e6d}{for\_each}}(\mbox{\hyperlink{namespacetheo_1_1decomp_af96177687d0ad683c5897d8fa01135f9acf6baee49c2ddb7e89724231bbd75d4a}{std::function}}<\textcolor{keywordtype}{void}(\mbox{\hyperlink{classtheo_1_1decomp_1_1symbol__t}{decomp::symbol\_t}}\& sym)> fn);}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00095}00095 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00096}00096 \textcolor{comment}{ /// <summary>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00097}00097 \textcolor{comment}{ /// returns the size of the symbol table.}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00098}00098 \textcolor{comment}{ /// </summary>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00099}00099 \textcolor{comment}{ /// <returns>returns the size of the symbol table.</returns>}}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00100}00100 \textcolor{comment}{} std::uint32\_t \mbox{\hyperlink{classtheo_1_1recomp_1_1symbol__table__t_af57c0495a442ea86af0f9cca4521631e}{size}}();}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00101}00101 }
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00102}00102 \textcolor{keyword}{private}:}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00103}00103 std::map<std::size\_t, decomp::symbol\_t> m\_table;}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00104}00104 \};}
\DoxyCodeLine{\Hypertarget{symbol__table_8hpp_source_l00105}00105 \} \textcolor{comment}{// namespace theo::recomp}}
\end{DoxyCode}