\hypertarget{classConfigNodeId}{
\section{ConfigNodeId Class Reference}
\label{classConfigNodeId}\index{ConfigNodeId@{ConfigNodeId}}
}


Class for encoding and decoding configuration-\/related node IDs.  




{\ttfamily \#include $<$config\_\-node\_\-id.hh$>$}

\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classConfigNodeId_a0f6ea1d84186a81fa5879e7ba1a3f432}{
typedef uint64\_\-t {\bfseries UniqueNodeId}}
\label{classConfigNodeId_a0f6ea1d84186a81fa5879e7ba1a3f432}

\item 
\hypertarget{classConfigNodeId_a9722e341792d77d3904ebd006c85b0dd}{
typedef uint64\_\-t {\bfseries Position}}
\label{classConfigNodeId_a9722e341792d77d3904ebd006c85b0dd}

\item 
\hypertarget{classConfigNodeId_a18f3f59aea8620a88fe71803415f291c}{
typedef uint32\_\-t {\bfseries InstanceId}}
\label{classConfigNodeId_a18f3f59aea8620a88fe71803415f291c}

\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classConfigNodeId_aff5b3c60c6bc43136ad68cc49485303f}{ConfigNodeId} (const string \&s)  throw (InvalidString)
\begin{DoxyCompactList}\small\item\em Constructor from a string. \item\end{DoxyCompactList}\item 
\hyperlink{classConfigNodeId_a3dc8a5f662f5aadedce3f60378406b78}{ConfigNodeId} (const UniqueNodeId \&unique\_\-node\_\-id, const Position \&position)
\begin{DoxyCompactList}\small\item\em Constructor for a given unique node ID and position. \item\end{DoxyCompactList}\item 
\hypertarget{classConfigNodeId_abf65d0819695789c73ab345b027e01d4}{
virtual \hyperlink{classConfigNodeId_abf65d0819695789c73ab345b027e01d4}{$\sim$ConfigNodeId} ()}
\label{classConfigNodeId_abf65d0819695789c73ab345b027e01d4}

\begin{DoxyCompactList}\small\item\em Destructor. \item\end{DoxyCompactList}\item 
size\_\-t \hyperlink{classConfigNodeId_ada609c3ed9787c332490efc2a4eb8e9d}{copy\_\-in} (const string \&from\_\-string)  throw (InvalidString)
\begin{DoxyCompactList}\small\item\em Copy an unique node ID from a string into \hyperlink{classConfigNodeId}{ConfigNodeId} structure. \item\end{DoxyCompactList}\item 
bool \hyperlink{classConfigNodeId_aee27e4442936815931910ce4f21c67f2}{operator==} (const \hyperlink{classConfigNodeId}{ConfigNodeId} \&other) const 
\begin{DoxyCompactList}\small\item\em Equality Operator. \item\end{DoxyCompactList}\item 
const UniqueNodeId \& \hyperlink{classConfigNodeId_a53cf51297e2cc1dff08384a2d9b40660}{unique\_\-node\_\-id} () const 
\begin{DoxyCompactList}\small\item\em Return \hyperlink{protocolthe-p}{the} unique node ID. \item\end{DoxyCompactList}\item 
const Position \& \hyperlink{classConfigNodeId_acfe3c74820ade44c59a11e31041bfecc}{position} () const 
\begin{DoxyCompactList}\small\item\em Return \hyperlink{protocolthe-p}{the} position of \hyperlink{protocolthe-p}{the} node. \item\end{DoxyCompactList}\item 
void \hyperlink{classConfigNodeId_a8b5c07c821370ac0e3eb687e0bb18181}{set\_\-instance\_\-id} (const InstanceId \&v)
\begin{DoxyCompactList}\small\item\em Set \hyperlink{protocolthe-p}{the} instance ID. \item\end{DoxyCompactList}\item 
void \hyperlink{classConfigNodeId_ac129d42f0b0d69eb975367bb26f8e5e2}{set\_\-position} (const Position \&v)
\begin{DoxyCompactList}\small\item\em Set \hyperlink{protocolthe-p}{the} node position. \item\end{DoxyCompactList}\item 
const \hyperlink{classConfigNodeId}{ConfigNodeId} \& \hyperlink{classConfigNodeId_a38026a107333ffb8dca5b46706349266}{generate\_\-unique\_\-node\_\-id} ()
\begin{DoxyCompactList}\small\item\em Generate a new unique node ID. \item\end{DoxyCompactList}\item 
string \hyperlink{classConfigNodeId_ad35239dd616e88b83c74976df8c4a684}{str} () const 
\begin{DoxyCompactList}\small\item\em Convert this node ID from binary form to presentation format. \item\end{DoxyCompactList}\item 
bool \hyperlink{classConfigNodeId_a3bc6306bba76f6836eb4af4c828bf250}{is\_\-empty} () const 
\begin{DoxyCompactList}\small\item\em Test if \hyperlink{protocolthe-p}{the} node ID is empty. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classConfigNodeId_a35f76d64b5ab70dd37e5116b101e8a8a}{
static \hyperlink{classConfigNodeId}{ConfigNodeId} \hyperlink{classConfigNodeId_a35f76d64b5ab70dd37e5116b101e8a8a}{ZERO} ()}
\label{classConfigNodeId_a35f76d64b5ab70dd37e5116b101e8a8a}

\begin{DoxyCompactList}\small\item\em Pre-\/defined constants. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classConfigNodeId_afa42bbdd8daf70b02a92d14f02b5faaa}{
UniqueNodeId {\bfseries \_\-unique\_\-node\_\-id}}
\label{classConfigNodeId_afa42bbdd8daf70b02a92d14f02b5faaa}

\item 
\hypertarget{classConfigNodeId_a8a5ea09e9f5e61a526af03727673beca}{
Position {\bfseries \_\-position}}
\label{classConfigNodeId_a8a5ea09e9f5e61a526af03727673beca}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
Class for encoding and decoding configuration-\/related node IDs. The node ID is composed of two uint64\_\-t integers. The first integer is \hyperlink{protocolthe-p}{the} unique node ID. The second integer is \hyperlink{protocolthe-p}{the} node positiion and is set to \hyperlink{protocolthe-p}{the} unique node ID of \hyperlink{protocolthe-p}{the} previous node. If it is \hyperlink{protocolthe-p}{the} first node, then \hyperlink{protocolthe-p}{the} position is set to 0. The upper half of \hyperlink{protocolthe-p}{the} unique node ID (\hyperlink{protocolthe-p}{the} most significant 32 bits) is \hyperlink{protocolthe-p}{the} instance ID. The lower half of \hyperlink{protocolthe-p}{the} unique node ID (\hyperlink{protocolthe-p}{the} least significant 32 bits) is \hyperlink{protocolthe-p}{the} unique part of \hyperlink{protocolthe-p}{the} node ID for that instance. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classConfigNodeId_aff5b3c60c6bc43136ad68cc49485303f}{
\index{ConfigNodeId@{ConfigNodeId}!ConfigNodeId@{ConfigNodeId}}
\index{ConfigNodeId@{ConfigNodeId}!ConfigNodeId@{ConfigNodeId}}
\subsubsection[{ConfigNodeId}]{\setlength{\rightskip}{0pt plus 5cm}ConfigNodeId::ConfigNodeId (
\begin{DoxyParamCaption}
\item[{const string \&}]{s}
\end{DoxyParamCaption}
)  throw ({\bf InvalidString})\hspace{0.3cm}{\ttfamily  \mbox{[}inline, explicit\mbox{]}}}}
\label{classConfigNodeId_aff5b3c60c6bc43136ad68cc49485303f}


Constructor from a string. 

The string format is two uint64\_\-t integers separated by space. The first integer is \hyperlink{protocolthe-p}{the} unique node ID. The second integer is \hyperlink{protocolthe-p}{the} node positiion and is set to \hyperlink{protocolthe-p}{the} unique node ID of \hyperlink{protocolthe-p}{the} previous node. If it is \hyperlink{protocolthe-p}{the} first node, then \hyperlink{protocolthe-p}{the} position is set to 0.


\begin{DoxyParams}{Parameters}
{\em s} & \hyperlink{protocolthe-p}{the} initialization string. \\
\hline
\end{DoxyParams}
\hypertarget{classConfigNodeId_a3dc8a5f662f5aadedce3f60378406b78}{
\index{ConfigNodeId@{ConfigNodeId}!ConfigNodeId@{ConfigNodeId}}
\index{ConfigNodeId@{ConfigNodeId}!ConfigNodeId@{ConfigNodeId}}
\subsubsection[{ConfigNodeId}]{\setlength{\rightskip}{0pt plus 5cm}ConfigNodeId::ConfigNodeId (
\begin{DoxyParamCaption}
\item[{const UniqueNodeId \&}]{unique\_\-node\_\-id, }
\item[{const Position \&}]{position}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classConfigNodeId_a3dc8a5f662f5aadedce3f60378406b78}


Constructor for a given unique node ID and position. 


\begin{DoxyParams}{Parameters}
{\em unique\_\-node\_\-id} & \hyperlink{protocolthe-p}{the} unique node ID. \\
\hline
{\em position} & \hyperlink{protocolthe-p}{the} position of \hyperlink{protocolthe-p}{the} node. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\hypertarget{classConfigNodeId_ada609c3ed9787c332490efc2a4eb8e9d}{
\index{ConfigNodeId@{ConfigNodeId}!copy\_\-in@{copy\_\-in}}
\index{copy\_\-in@{copy\_\-in}!ConfigNodeId@{ConfigNodeId}}
\subsubsection[{copy\_\-in}]{\setlength{\rightskip}{0pt plus 5cm}size\_\-t ConfigNodeId::copy\_\-in (
\begin{DoxyParamCaption}
\item[{const string \&}]{from\_\-string}
\end{DoxyParamCaption}
)  throw ({\bf InvalidString})\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classConfigNodeId_ada609c3ed9787c332490efc2a4eb8e9d}


Copy an unique node ID from a string into \hyperlink{classConfigNodeId}{ConfigNodeId} structure. 


\begin{DoxyParams}{Parameters}
{\em from\_\-string} & \hyperlink{protocolthe-p}{the} string to copy \hyperlink{protocolthe-p}{the} node ID from. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} number of copied octets. 
\end{DoxyReturn}
\hypertarget{classConfigNodeId_a38026a107333ffb8dca5b46706349266}{
\index{ConfigNodeId@{ConfigNodeId}!generate\_\-unique\_\-node\_\-id@{generate\_\-unique\_\-node\_\-id}}
\index{generate\_\-unique\_\-node\_\-id@{generate\_\-unique\_\-node\_\-id}!ConfigNodeId@{ConfigNodeId}}
\subsubsection[{generate\_\-unique\_\-node\_\-id}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf ConfigNodeId} \& ConfigNodeId::generate\_\-unique\_\-node\_\-id (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classConfigNodeId_a38026a107333ffb8dca5b46706349266}


Generate a new unique node ID. 

Note that this instance is modified to \hyperlink{protocolthe-p}{the} value of \hyperlink{protocolthe-p}{the} new unique node ID.

\begin{DoxyReturn}{Returns}
a new unique node ID. 
\end{DoxyReturn}
\hypertarget{classConfigNodeId_a3bc6306bba76f6836eb4af4c828bf250}{
\index{ConfigNodeId@{ConfigNodeId}!is\_\-empty@{is\_\-empty}}
\index{is\_\-empty@{is\_\-empty}!ConfigNodeId@{ConfigNodeId}}
\subsubsection[{is\_\-empty}]{\setlength{\rightskip}{0pt plus 5cm}bool ConfigNodeId::is\_\-empty (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classConfigNodeId_a3bc6306bba76f6836eb4af4c828bf250}


Test if \hyperlink{protocolthe-p}{the} node ID is empty. 

\begin{DoxyReturn}{Returns}
true if \hyperlink{protocolthe-p}{the} node ID is empty, otherwise false. 
\end{DoxyReturn}
\hypertarget{classConfigNodeId_aee27e4442936815931910ce4f21c67f2}{
\index{ConfigNodeId@{ConfigNodeId}!operator==@{operator==}}
\index{operator==@{operator==}!ConfigNodeId@{ConfigNodeId}}
\subsubsection[{operator==}]{\setlength{\rightskip}{0pt plus 5cm}bool ConfigNodeId::operator== (
\begin{DoxyParamCaption}
\item[{const {\bf ConfigNodeId} \&}]{other}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classConfigNodeId_aee27e4442936815931910ce4f21c67f2}


Equality Operator. 


\begin{DoxyParams}{Parameters}
{\em other} & \hyperlink{protocolthe-p}{the} right-\/hand operand to compare against. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if \hyperlink{protocolthe-p}{the} left-\/hand operand is numerically same as \hyperlink{protocolthe-p}{the} right-\/hand operand. 
\end{DoxyReturn}
\hypertarget{classConfigNodeId_acfe3c74820ade44c59a11e31041bfecc}{
\index{ConfigNodeId@{ConfigNodeId}!position@{position}}
\index{position@{position}!ConfigNodeId@{ConfigNodeId}}
\subsubsection[{position}]{\setlength{\rightskip}{0pt plus 5cm}const Position\& ConfigNodeId::position (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classConfigNodeId_acfe3c74820ade44c59a11e31041bfecc}


Return \hyperlink{protocolthe-p}{the} position of \hyperlink{protocolthe-p}{the} node. 

\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} position of \hyperlink{protocolthe-p}{the} node. 
\end{DoxyReturn}
\hypertarget{classConfigNodeId_a8b5c07c821370ac0e3eb687e0bb18181}{
\index{ConfigNodeId@{ConfigNodeId}!set\_\-instance\_\-id@{set\_\-instance\_\-id}}
\index{set\_\-instance\_\-id@{set\_\-instance\_\-id}!ConfigNodeId@{ConfigNodeId}}
\subsubsection[{set\_\-instance\_\-id}]{\setlength{\rightskip}{0pt plus 5cm}void ConfigNodeId::set\_\-instance\_\-id (
\begin{DoxyParamCaption}
\item[{const InstanceId \&}]{v}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classConfigNodeId_a8b5c07c821370ac0e3eb687e0bb18181}


Set \hyperlink{protocolthe-p}{the} instance ID. 


\begin{DoxyParams}{Parameters}
{\em v} & \hyperlink{protocolthe-p}{the} instance ID. \\
\hline
\end{DoxyParams}
\hypertarget{classConfigNodeId_ac129d42f0b0d69eb975367bb26f8e5e2}{
\index{ConfigNodeId@{ConfigNodeId}!set\_\-position@{set\_\-position}}
\index{set\_\-position@{set\_\-position}!ConfigNodeId@{ConfigNodeId}}
\subsubsection[{set\_\-position}]{\setlength{\rightskip}{0pt plus 5cm}void ConfigNodeId::set\_\-position (
\begin{DoxyParamCaption}
\item[{const Position \&}]{v}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classConfigNodeId_ac129d42f0b0d69eb975367bb26f8e5e2}


Set \hyperlink{protocolthe-p}{the} node position. 

The node position is equal to \hyperlink{protocolthe-p}{the} unique node ID of \hyperlink{protocolthe-p}{the} previous node.


\begin{DoxyParams}{Parameters}
{\em v} & \hyperlink{protocolthe-p}{the} node position. \\
\hline
\end{DoxyParams}
\hypertarget{classConfigNodeId_ad35239dd616e88b83c74976df8c4a684}{
\index{ConfigNodeId@{ConfigNodeId}!str@{str}}
\index{str@{str}!ConfigNodeId@{ConfigNodeId}}
\subsubsection[{str}]{\setlength{\rightskip}{0pt plus 5cm}string ConfigNodeId::str (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classConfigNodeId_ad35239dd616e88b83c74976df8c4a684}


Convert this node ID from binary form to presentation format. 

\begin{DoxyReturn}{Returns}
C++ string with \hyperlink{protocolthe-p}{the} human-\/readable ASCII representation of \hyperlink{protocolthe-p}{the} node ID. 
\end{DoxyReturn}
\hypertarget{classConfigNodeId_a53cf51297e2cc1dff08384a2d9b40660}{
\index{ConfigNodeId@{ConfigNodeId}!unique\_\-node\_\-id@{unique\_\-node\_\-id}}
\index{unique\_\-node\_\-id@{unique\_\-node\_\-id}!ConfigNodeId@{ConfigNodeId}}
\subsubsection[{unique\_\-node\_\-id}]{\setlength{\rightskip}{0pt plus 5cm}const UniqueNodeId\& ConfigNodeId::unique\_\-node\_\-id (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classConfigNodeId_a53cf51297e2cc1dff08384a2d9b40660}


Return \hyperlink{protocolthe-p}{the} unique node ID. 

\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} unique node ID. 
\end{DoxyReturn}


The documentation for this class was generated from the following file:\begin{DoxyCompactItemize}
\item 
/home/greearb/git/xorp.ct.github/xorp/libproto/config\_\-node\_\-id.hh\end{DoxyCompactItemize}
