\hypertarget{struct_ogre_1_1_id_string}{}\section{Ogre\+:\+:Id\+String Struct Reference}
\label{struct_ogre_1_1_id_string}\index{Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}}


Hashed string.  




{\ttfamily \#include $<$Ogre\+Id\+String.\+h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{struct_ogre_1_1_id_string_aafe0decfa1fbd2be4d46609ffc5647d5}{Id\+String} ()
\item 
\hyperlink{struct_ogre_1_1_id_string_a56caa2838bf509872f4595c183e2fe6f}{Id\+String} (const char $\ast$string)
\item 
\hyperlink{struct_ogre_1_1_id_string_a37ea40cc268d6cdacf235c09d0d48720}{Id\+String} (const std\+::string \&string)
\item 
\hyperlink{struct_ogre_1_1_id_string_a3f65ef76705bbe55689dd4affed6df06}{Id\+String} (\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32} value)
\item 
std\+::string \hyperlink{struct_ogre_1_1_id_string_a58af7942c44e5907144fa4efe18c84a9}{get\+Friendly\+Text} () const
\begin{DoxyCompactList}\small\item\em Returns \char`\"{}\mbox{[}\+Hash 0x0a0100ef\mbox{]}\char`\"{} strings in Release mode, readable string in debug. \end{DoxyCompactList}\item 
std\+::string \hyperlink{struct_ogre_1_1_id_string_aedc10c2eb528fe8c1d8d2ab415500d7b}{get\+Release\+Text} () const
\begin{DoxyCompactList}\small\item\em Always returns \char`\"{}\mbox{[}\+Hash 0x0a0100ef\mbox{]}\char`\"{} strings in any mode. \end{DoxyCompactList}\item 
bool \hyperlink{struct_ogre_1_1_id_string_ae1f1d56fc07be8fcc9f15120c505d00f}{operator!=} (\hyperlink{struct_ogre_1_1_id_string}{Id\+String} id\+String) const
\item 
\hyperlink{struct_ogre_1_1_id_string}{Id\+String} \hyperlink{struct_ogre_1_1_id_string_afbe35aa8a428bd10ca8588921891860f}{operator+} (\hyperlink{struct_ogre_1_1_id_string}{Id\+String} id\+String) const
\item 
void \hyperlink{struct_ogre_1_1_id_string_a1975a7a2705e2ff8b15c3143636addec}{operator+=} (\hyperlink{struct_ogre_1_1_id_string}{Id\+String} id\+String)
\item 
bool \hyperlink{struct_ogre_1_1_id_string_aa879e3cd371deb2979f1f5d4b8977d44}{operator$<$} (\hyperlink{struct_ogre_1_1_id_string}{Id\+String} id\+String) const
\item 
bool \hyperlink{struct_ogre_1_1_id_string_ad8d64faf790e160a7dc4f1ed61598df1}{operator==} (\hyperlink{struct_ogre_1_1_id_string}{Id\+String} id\+String) const
\end{DoxyCompactItemize}
\subsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32} \hyperlink{struct_ogre_1_1_id_string_a54eeffe30aae07b2f4b7bf7a8cf10d27}{m\+Hash}
\end{DoxyCompactItemize}
\subsection*{Static Public Attributes}
\begin{DoxyCompactItemize}
\item 
static const uint32\+\_\+t \hyperlink{struct_ogre_1_1_id_string_a34d6188685e991789d904b1151d16f07}{Seed} = 0x3\+A8\+E\+F\+A67
\end{DoxyCompactItemize}


\subsection{Detailed Description}
Hashed string. 

An \hyperlink{struct_ogre_1_1_id_string}{Id\+String} is meant to be passed by value rather than by reference since in Release mode it\textquotesingle{}s just an encapsulated integer. The default implementation uses a 32-\/bit uint. A hash = 0 is the default initialization, and assumed by \hyperlink{namespace_ogre}{Ogre} to mean an \hyperlink{struct_ogre_1_1_id_string}{Id\+String} is empty or unspecified. \begin{DoxyParagraph}{}
Note that \hyperlink{struct_ogre_1_1_id_string}{Id\+String}(\char`\"{}\char`\"{}) != Id\+String(0) != \hyperlink{struct_ogre_1_1_id_string_aafe0decfa1fbd2be4d46609ffc5647d5}{Id\+String()} The latter indicates m\+Hash == 0 (the default initialization). While the first one will hash the empty string \char`\"{}\char`\"{}, and the second will attempt to hash the number 0, producing up to three possible outputs. 
\end{DoxyParagraph}
\begin{DoxyParagraph}{}
Id\+Strings convert regular String to hashes A\+ND A\+RE D\+E\+S\+T\+R\+U\+C\+T\+I\+VE. This means that you may no longer recover the real string it was constructed from. When the original data is not available get\+Friendly\+Text returns \mbox{[}Hash 0x0a0100ef\mbox{]} (in the example that m\+Hash = 0x0a0100ef)$\ast$ In debug mode (O\+G\+R\+E\+\_\+\+D\+E\+B\+U\+G\+\_\+\+M\+O\+DE is defined), Id\+Strings try to maintain a copy of the original string for two purposes\+:
\begin{DoxyEnumerate}
\item Easy debugging\+: Reading \char`\"{}\+Texture/diffuse.\+png\char`\"{} is much nicer than \char`\"{}0x0a0100ef\char`\"{}
\item Hash collision\+: If \hyperlink{namespace_ogre}{Ogre} finds two Id\+Strings are identical but their original strings are not, an assertion will trigger indicating a collision has been found. Note that this isn\textquotesingle{}t foolproof. Note\+: When \hyperlink{struct_ogre_1_1_id_string_a3f65ef76705bbe55689dd4affed6df06}{Id\+String( uint32 )} was used to hash an integer, get\+Friendly\+Text will return \char`\"{}\mbox{[}\+Value 0x1234567\mbox{]}\char`\"{} 
\end{DoxyEnumerate}
\end{DoxyParagraph}
\begin{DoxyParagraph}{}
Id\+Strings can be concatenated\+: \hyperlink{struct_ogre_1_1_id_string}{Id\+String}( \char`\"{}\+Hello.\char`\"{} ) + \hyperlink{struct_ogre_1_1_id_string}{Id\+String}( \char`\"{} How are you?\char`\"{} ) produc a new \hyperlink{struct_ogre_1_1_id_string}{Id\+String}, but please note that it may not be the same as doing \hyperlink{struct_ogre_1_1_id_string}{Id\+String}( \char`\"{}\+Hello. How are you?\char`\"{} ) depending on the hashing function used (by default, we use Murmur\+Hash3, 
\end{DoxyParagraph}
\begin{DoxySeeAlso}{See also}
\hyperlink{_ogre_id_string_8h_a295b313eb759fefc52c8e195bb9c8e01}{O\+G\+R\+E\+\_\+\+H\+A\+S\+H\+\_\+\+F\+U\+NC})
\end{DoxySeeAlso}
\begin{DoxyRemark}{Remarks}
Hash collision detection isn\textquotesingle{}t foolproof because we keep a fixed string copy of the original string. If the original string is too long, it will be truncated and there is an extremely low possibility that their truncation becomes the same string, and their hashes also become equal, when the original strings were not. i.\+e. Very\+Looooooong/\+String and Ultraaaaa\+Loong/\+String could both become \char`\"{}/\+String\char`\"{} and happen to also hash to the same number. 
\end{DoxyRemark}
\begin{DoxyParagraph}{}
In practice we truncate to 32 bytes. If your fear this is too little for you and also fear about collisions, increase 
\end{DoxyParagraph}
\begin{DoxySeeAlso}{See also}
O\+G\+R\+E\+\_\+\+D\+E\+B\+U\+G\+\_\+\+S\+T\+R\+\_\+\+S\+I\+ZE 
\end{DoxySeeAlso}
\begin{DoxyAuthor}{Author}
Matias N. Goldberg 
\end{DoxyAuthor}
\begin{DoxyVersion}{Version}
1.\+0 
\end{DoxyVersion}


\subsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{struct_ogre_1_1_id_string_aafe0decfa1fbd2be4d46609ffc5647d5}\label{struct_ogre_1_1_id_string_aafe0decfa1fbd2be4d46609ffc5647d5}} 
\index{Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}!Id\+String@{Id\+String}}
\index{Id\+String@{Id\+String}!Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}}
\subsubsection{\texorpdfstring{Id\+String()}{IdString()}\hspace{0.1cm}{\footnotesize\ttfamily [1/4]}}
{\footnotesize\ttfamily Ogre\+::\+Id\+String\+::\+Id\+String (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

\mbox{\Hypertarget{struct_ogre_1_1_id_string_a56caa2838bf509872f4595c183e2fe6f}\label{struct_ogre_1_1_id_string_a56caa2838bf509872f4595c183e2fe6f}} 
\index{Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}!Id\+String@{Id\+String}}
\index{Id\+String@{Id\+String}!Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}}
\subsubsection{\texorpdfstring{Id\+String()}{IdString()}\hspace{0.1cm}{\footnotesize\ttfamily [2/4]}}
{\footnotesize\ttfamily Ogre\+::\+Id\+String\+::\+Id\+String (\begin{DoxyParamCaption}\item[{const char $\ast$}]{string }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



References O\+G\+R\+E\+\_\+\+C\+O\+P\+Y\+\_\+\+D\+E\+B\+U\+G\+\_\+\+S\+T\+R\+I\+NG, and O\+G\+R\+E\+\_\+\+H\+A\+S\+H\+\_\+\+F\+U\+NC.

\mbox{\Hypertarget{struct_ogre_1_1_id_string_a37ea40cc268d6cdacf235c09d0d48720}\label{struct_ogre_1_1_id_string_a37ea40cc268d6cdacf235c09d0d48720}} 
\index{Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}!Id\+String@{Id\+String}}
\index{Id\+String@{Id\+String}!Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}}
\subsubsection{\texorpdfstring{Id\+String()}{IdString()}\hspace{0.1cm}{\footnotesize\ttfamily [3/4]}}
{\footnotesize\ttfamily Ogre\+::\+Id\+String\+::\+Id\+String (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{string }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



References O\+G\+R\+E\+\_\+\+C\+O\+P\+Y\+\_\+\+D\+E\+B\+U\+G\+\_\+\+S\+T\+R\+I\+NG, and O\+G\+R\+E\+\_\+\+H\+A\+S\+H\+\_\+\+F\+U\+NC.

\mbox{\Hypertarget{struct_ogre_1_1_id_string_a3f65ef76705bbe55689dd4affed6df06}\label{struct_ogre_1_1_id_string_a3f65ef76705bbe55689dd4affed6df06}} 
\index{Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}!Id\+String@{Id\+String}}
\index{Id\+String@{Id\+String}!Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}}
\subsubsection{\texorpdfstring{Id\+String()}{IdString()}\hspace{0.1cm}{\footnotesize\ttfamily [4/4]}}
{\footnotesize\ttfamily Ogre\+::\+Id\+String\+::\+Id\+String (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32}}]{value }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



References O\+G\+R\+E\+\_\+\+A\+P\+P\+E\+N\+D\+\_\+\+D\+E\+B\+U\+G\+\_\+\+S\+T\+R\+I\+NG, O\+G\+R\+E\+\_\+\+C\+O\+P\+Y\+\_\+\+D\+E\+B\+U\+G\+\_\+\+S\+T\+R\+I\+NG, and O\+G\+R\+E\+\_\+\+H\+A\+S\+H\+\_\+\+F\+U\+NC.



\subsection{Member Function Documentation}
\mbox{\Hypertarget{struct_ogre_1_1_id_string_a1975a7a2705e2ff8b15c3143636addec}\label{struct_ogre_1_1_id_string_a1975a7a2705e2ff8b15c3143636addec}} 
\index{Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}!operator+=@{operator+=}}
\index{operator+=@{operator+=}!Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}}
\subsubsection{\texorpdfstring{operator+=()}{operator+=()}}
{\footnotesize\ttfamily void Ogre\+::\+Id\+String\+::operator+= (\begin{DoxyParamCaption}\item[{\hyperlink{struct_ogre_1_1_id_string}{Id\+String}}]{id\+String }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



References m\+Hash, O\+G\+R\+E\+\_\+\+A\+P\+P\+E\+N\+D\+\_\+\+D\+E\+B\+U\+G\+\_\+\+S\+T\+R\+I\+NG, and O\+G\+R\+E\+\_\+\+H\+A\+S\+H\+\_\+\+F\+U\+NC.

\mbox{\Hypertarget{struct_ogre_1_1_id_string_afbe35aa8a428bd10ca8588921891860f}\label{struct_ogre_1_1_id_string_afbe35aa8a428bd10ca8588921891860f}} 
\index{Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}!operator+@{operator+}}
\index{operator+@{operator+}!Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}}
\subsubsection{\texorpdfstring{operator+()}{operator+()}}
{\footnotesize\ttfamily \hyperlink{struct_ogre_1_1_id_string}{Id\+String} Ogre\+::\+Id\+String\+::operator+ (\begin{DoxyParamCaption}\item[{\hyperlink{struct_ogre_1_1_id_string}{Id\+String}}]{id\+String }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

\mbox{\Hypertarget{struct_ogre_1_1_id_string_aa879e3cd371deb2979f1f5d4b8977d44}\label{struct_ogre_1_1_id_string_aa879e3cd371deb2979f1f5d4b8977d44}} 
\index{Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}!operator$<$@{operator$<$}}
\index{operator$<$@{operator$<$}!Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}}
\subsubsection{\texorpdfstring{operator$<$()}{operator<()}}
{\footnotesize\ttfamily bool Ogre\+::\+Id\+String\+::operator$<$ (\begin{DoxyParamCaption}\item[{\hyperlink{struct_ogre_1_1_id_string}{Id\+String}}]{id\+String }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



References m\+Hash.

\mbox{\Hypertarget{struct_ogre_1_1_id_string_ad8d64faf790e160a7dc4f1ed61598df1}\label{struct_ogre_1_1_id_string_ad8d64faf790e160a7dc4f1ed61598df1}} 
\index{Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}!operator==@{operator==}}
\index{operator==@{operator==}!Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}}
\subsubsection{\texorpdfstring{operator==()}{operator==()}}
{\footnotesize\ttfamily bool Ogre\+::\+Id\+String\+::operator== (\begin{DoxyParamCaption}\item[{\hyperlink{struct_ogre_1_1_id_string}{Id\+String}}]{id\+String }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



References m\+Hash.

\mbox{\Hypertarget{struct_ogre_1_1_id_string_ae1f1d56fc07be8fcc9f15120c505d00f}\label{struct_ogre_1_1_id_string_ae1f1d56fc07be8fcc9f15120c505d00f}} 
\index{Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}!operator"!=@{operator"!=}}
\index{operator"!=@{operator"!=}!Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}}
\subsubsection{\texorpdfstring{operator"!=()}{operator!=()}}
{\footnotesize\ttfamily bool Ogre\+::\+Id\+String\+::operator!= (\begin{DoxyParamCaption}\item[{\hyperlink{struct_ogre_1_1_id_string}{Id\+String}}]{id\+String }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



References m\+Hash.

\mbox{\Hypertarget{struct_ogre_1_1_id_string_a58af7942c44e5907144fa4efe18c84a9}\label{struct_ogre_1_1_id_string_a58af7942c44e5907144fa4efe18c84a9}} 
\index{Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}!get\+Friendly\+Text@{get\+Friendly\+Text}}
\index{get\+Friendly\+Text@{get\+Friendly\+Text}!Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}}
\subsubsection{\texorpdfstring{get\+Friendly\+Text()}{getFriendlyText()}}
{\footnotesize\ttfamily std\+::string Ogre\+::\+Id\+String\+::get\+Friendly\+Text (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Returns \char`\"{}\mbox{[}\+Hash 0x0a0100ef\mbox{]}\char`\"{} strings in Release mode, readable string in debug. 



References get\+Release\+Text().

\mbox{\Hypertarget{struct_ogre_1_1_id_string_aedc10c2eb528fe8c1d8d2ab415500d7b}\label{struct_ogre_1_1_id_string_aedc10c2eb528fe8c1d8d2ab415500d7b}} 
\index{Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}!get\+Release\+Text@{get\+Release\+Text}}
\index{get\+Release\+Text@{get\+Release\+Text}!Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}}
\subsubsection{\texorpdfstring{get\+Release\+Text()}{getReleaseText()}}
{\footnotesize\ttfamily std\+::string Ogre\+::\+Id\+String\+::get\+Release\+Text (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Always returns \char`\"{}\mbox{[}\+Hash 0x0a0100ef\mbox{]}\char`\"{} strings in any mode. 



References O\+G\+R\+E\+\_\+\+H\+A\+S\+H\+\_\+\+B\+I\+TS.



Referenced by get\+Friendly\+Text().



\subsection{Member Data Documentation}
\mbox{\Hypertarget{struct_ogre_1_1_id_string_a34d6188685e991789d904b1151d16f07}\label{struct_ogre_1_1_id_string_a34d6188685e991789d904b1151d16f07}} 
\index{Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}!Seed@{Seed}}
\index{Seed@{Seed}!Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}}
\subsubsection{\texorpdfstring{Seed}{Seed}}
{\footnotesize\ttfamily const uint32\+\_\+t Ogre\+::\+Id\+String\+::\+Seed = 0x3\+A8\+E\+F\+A67\hspace{0.3cm}{\ttfamily [static]}}



Referenced by Ogre\+::calc\+Hash().

\mbox{\Hypertarget{struct_ogre_1_1_id_string_a54eeffe30aae07b2f4b7bf7a8cf10d27}\label{struct_ogre_1_1_id_string_a54eeffe30aae07b2f4b7bf7a8cf10d27}} 
\index{Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}!m\+Hash@{m\+Hash}}
\index{m\+Hash@{m\+Hash}!Ogre\+::\+Id\+String@{Ogre\+::\+Id\+String}}
\subsubsection{\texorpdfstring{m\+Hash}{mHash}}
{\footnotesize\ttfamily \hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32} Ogre\+::\+Id\+String\+::m\+Hash}



Referenced by operator!=(), operator+=(), operator$<$(), and operator==().



The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
\hyperlink{_ogre_id_string_8h}{Ogre\+Id\+String.\+h}\end{DoxyCompactItemize}
