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


Hashed string.  




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

\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{struct_ogre_1_1_id_string_aafe0decfa1fbd2be4d46609ffc5647d5}{Id\+String}} ()
\item 
\mbox{\hyperlink{struct_ogre_1_1_id_string_a56caa2838bf509872f4595c183e2fe6f}{Id\+String}} (const char $\ast$string)
\item 
\mbox{\hyperlink{struct_ogre_1_1_id_string_a37ea40cc268d6cdacf235c09d0d48720}{Id\+String}} (const std\+::string \&string)
\item 
\mbox{\hyperlink{struct_ogre_1_1_id_string_a3f65ef76705bbe55689dd4affed6df06}{Id\+String}} (\mbox{\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32}} value)
\item 
std\+::string \mbox{\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 \mbox{\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 \mbox{\hyperlink{struct_ogre_1_1_id_string_ae1f1d56fc07be8fcc9f15120c505d00f}{operator!=}} (\mbox{\hyperlink{struct_ogre_1_1_id_string}{Id\+String}} id\+String) const
\item 
\mbox{\hyperlink{struct_ogre_1_1_id_string}{Id\+String}} \mbox{\hyperlink{struct_ogre_1_1_id_string_afbe35aa8a428bd10ca8588921891860f}{operator+}} (\mbox{\hyperlink{struct_ogre_1_1_id_string}{Id\+String}} id\+String) const
\item 
void \mbox{\hyperlink{struct_ogre_1_1_id_string_a1975a7a2705e2ff8b15c3143636addec}{operator+=}} (\mbox{\hyperlink{struct_ogre_1_1_id_string}{Id\+String}} id\+String)
\item 
bool \mbox{\hyperlink{struct_ogre_1_1_id_string_aa879e3cd371deb2979f1f5d4b8977d44}{operator$<$}} (\mbox{\hyperlink{struct_ogre_1_1_id_string}{Id\+String}} id\+String) const
\item 
bool \mbox{\hyperlink{struct_ogre_1_1_id_string_ad8d64faf790e160a7dc4f1ed61598df1}{operator==}} (\mbox{\hyperlink{struct_ogre_1_1_id_string}{Id\+String}} id\+String) const
\end{DoxyCompactItemize}
\doxysubsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32}} \mbox{\hyperlink{struct_ogre_1_1_id_string_a54eeffe30aae07b2f4b7bf7a8cf10d27}{m\+Hash}}
\end{DoxyCompactItemize}
\doxysubsection*{Static Public Attributes}
\begin{DoxyCompactItemize}
\item 
static const uint32\+\_\+t \mbox{\hyperlink{struct_ogre_1_1_id_string_a34d6188685e991789d904b1151d16f07}{Seed}} = 0x3\+A8\+E\+F\+A67
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Hashed string. 

An \mbox{\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 \mbox{\hyperlink{namespace_ogre}{Ogre}} to mean an \mbox{\hyperlink{struct_ogre_1_1_id_string}{Id\+String}} is empty or unspecified. \begin{DoxyParagraph}{}
Note that \mbox{\hyperlink{struct_ogre_1_1_id_string}{Id\+String}}(\char`\"{}\char`\"{}) != Id\+String(0) != \mbox{\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 \mbox{\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 \mbox{\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\+: \mbox{\hyperlink{struct_ogre_1_1_id_string}{Id\+String}}( \char`\"{}\+Hello.\char`\"{} ) + \mbox{\hyperlink{struct_ogre_1_1_id_string}{Id\+String}}( \char`\"{} How are you?\char`\"{} ) produc a new \mbox{\hyperlink{struct_ogre_1_1_id_string}{Id\+String}}, but please note that it may not be the same as doing \mbox{\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}
\mbox{\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}


\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{struct_ogre_1_1_id_string_aafe0decfa1fbd2be4d46609ffc5647d5}\label{struct_ogre_1_1_id_string_aafe0decfa1fbd2be4d46609ffc5647d5}} 
\index{Ogre::IdString@{Ogre::IdString}!IdString@{IdString}}
\index{IdString@{IdString}!Ogre::IdString@{Ogre::IdString}}
\doxysubsubsection{\texorpdfstring{IdString()}{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::IdString@{Ogre::IdString}!IdString@{IdString}}
\index{IdString@{IdString}!Ogre::IdString@{Ogre::IdString}}
\doxysubsubsection{\texorpdfstring{IdString()}{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 m\+Hash, O\+G\+R\+E\+\_\+\+C\+O\+P\+Y\+\_\+\+D\+E\+B\+U\+G\+\_\+\+S\+T\+R\+I\+NG, O\+G\+R\+E\+\_\+\+H\+A\+S\+H\+\_\+\+F\+U\+NC, and Seed.

\mbox{\Hypertarget{struct_ogre_1_1_id_string_a37ea40cc268d6cdacf235c09d0d48720}\label{struct_ogre_1_1_id_string_a37ea40cc268d6cdacf235c09d0d48720}} 
\index{Ogre::IdString@{Ogre::IdString}!IdString@{IdString}}
\index{IdString@{IdString}!Ogre::IdString@{Ogre::IdString}}
\doxysubsubsection{\texorpdfstring{IdString()}{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 m\+Hash, O\+G\+R\+E\+\_\+\+C\+O\+P\+Y\+\_\+\+D\+E\+B\+U\+G\+\_\+\+S\+T\+R\+I\+NG, O\+G\+R\+E\+\_\+\+H\+A\+S\+H\+\_\+\+F\+U\+NC, and Seed.

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



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



\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{struct_ogre_1_1_id_string_a1975a7a2705e2ff8b15c3143636addec}\label{struct_ogre_1_1_id_string_a1975a7a2705e2ff8b15c3143636addec}} 
\index{Ogre::IdString@{Ogre::IdString}!operator+=@{operator+=}}
\index{operator+=@{operator+=}!Ogre::IdString@{Ogre::IdString}}
\doxysubsubsection{\texorpdfstring{operator+=()}{operator+=()}}
{\footnotesize\ttfamily void Ogre\+::\+Id\+String\+::operator+= (\begin{DoxyParamCaption}\item[{\mbox{\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, O\+G\+R\+E\+\_\+\+H\+A\+S\+H\+\_\+\+F\+U\+NC, and Seed.

\mbox{\Hypertarget{struct_ogre_1_1_id_string_afbe35aa8a428bd10ca8588921891860f}\label{struct_ogre_1_1_id_string_afbe35aa8a428bd10ca8588921891860f}} 
\index{Ogre::IdString@{Ogre::IdString}!operator+@{operator+}}
\index{operator+@{operator+}!Ogre::IdString@{Ogre::IdString}}
\doxysubsubsection{\texorpdfstring{operator+()}{operator+()}}
{\footnotesize\ttfamily \mbox{\hyperlink{struct_ogre_1_1_id_string}{Id\+String}} Ogre\+::\+Id\+String\+::operator+ (\begin{DoxyParamCaption}\item[{\mbox{\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::IdString@{Ogre::IdString}!operator$<$@{operator$<$}}
\index{operator$<$@{operator$<$}!Ogre::IdString@{Ogre::IdString}}
\doxysubsubsection{\texorpdfstring{operator$<$()}{operator<()}}
{\footnotesize\ttfamily bool Ogre\+::\+Id\+String\+::operator$<$ (\begin{DoxyParamCaption}\item[{\mbox{\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::IdString@{Ogre::IdString}!operator==@{operator==}}
\index{operator==@{operator==}!Ogre::IdString@{Ogre::IdString}}
\doxysubsubsection{\texorpdfstring{operator==()}{operator==()}}
{\footnotesize\ttfamily bool Ogre\+::\+Id\+String\+::operator== (\begin{DoxyParamCaption}\item[{\mbox{\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::IdString@{Ogre::IdString}!operator"!=@{operator"!=}}
\index{operator"!=@{operator"!=}!Ogre::IdString@{Ogre::IdString}}
\doxysubsubsection{\texorpdfstring{operator"!=()}{operator!=()}}
{\footnotesize\ttfamily bool Ogre\+::\+Id\+String\+::operator!= (\begin{DoxyParamCaption}\item[{\mbox{\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::IdString@{Ogre::IdString}!getFriendlyText@{getFriendlyText}}
\index{getFriendlyText@{getFriendlyText}!Ogre::IdString@{Ogre::IdString}}
\doxysubsubsection{\texorpdfstring{getFriendlyText()}{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::IdString@{Ogre::IdString}!getReleaseText@{getReleaseText}}
\index{getReleaseText@{getReleaseText}!Ogre::IdString@{Ogre::IdString}}
\doxysubsubsection{\texorpdfstring{getReleaseText()}{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 m\+Hash, and O\+G\+R\+E\+\_\+\+H\+A\+S\+H\+\_\+\+B\+I\+TS.



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



\doxysubsection{Member Data Documentation}
\mbox{\Hypertarget{struct_ogre_1_1_id_string_a34d6188685e991789d904b1151d16f07}\label{struct_ogre_1_1_id_string_a34d6188685e991789d904b1151d16f07}} 
\index{Ogre::IdString@{Ogre::IdString}!Seed@{Seed}}
\index{Seed@{Seed}!Ogre::IdString@{Ogre::IdString}}
\doxysubsubsection{\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(), Id\+String(), and operator+=().

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



Referenced by get\+Release\+Text(), Id\+String(), operator!=(), operator+=(), operator$<$(), and operator==().



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