\hypertarget{DfiFile-Key_8hh}{
\section{DfiFile-Key.hh File Reference}
\label{DfiFile-Key_8hh}\index{DfiFile-Key.hh@{DfiFile-Key.hh}}
}
Layout and access for file keys. 

{\tt \#include \char`\"{}PBI/Endianness.h\char`\"{}}\par
\subsection*{Namespaces}
\begin{CompactItemize}
\item 
namespace \textbf{DfiFile}
\item 
namespace \hyperlink{namespaceKey}{Key}
\item 
namespace \textbf{DfiFile::Key}
\item 
namespace \hyperlink{namespaceKeyFmx}{KeyFmx}
\item 
namespace \textbf{DfiFile::KeyFmx}
\item 
namespace \hyperlink{namespaceKeyCmx}{KeyCmx}
\item 
namespace \textbf{DfiFile::KeyCmx}
\end{CompactItemize}
\subsection*{Classes}
\begin{CompactItemize}
\item 
struct \hyperlink{structDfiFile_1_1KeyGeneric__bf}{DfiFile::KeyGeneric\_\-bf}
\begin{CompactList}\small\item\em The bit field layout of a generic key. \item\end{CompactList}\item 
struct \hyperlink{structDfiFile_1_1KeyFmx__bf}{DfiFile::KeyFmx\_\-bf}
\begin{CompactList}\small\item\em The bit field layout of a FMX key. \item\end{CompactList}\item 
struct \hyperlink{structDfiFile_1_1KeyCmx__bf}{DfiFile::KeyCmx\_\-bf}
\begin{CompactList}\small\item\em The bit field layout of a CMX key. \item\end{CompactList}\item 
union \hyperlink{unionDfiFile_1_1Key__u}{DfiFile::Key\_\-u}
\begin{CompactList}\small\item\em Captures all the key types. \item\end{CompactList}\end{CompactItemize}
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum \textbf{Type} \{ \par
\hyperlink{namespaceDfiFile_1_1Key_3918a3589fc86f5f216e37b2f184c15b2586551046c6a68c0cb8f862d9a6d3e9}{DfiFile::Key::FMX} =  0, 
\par
\hyperlink{namespaceDfiFile_1_1Key_3918a3589fc86f5f216e37b2f184c15be1ba483589a128ac8d2d8c5d2eec0514}{DfiFile::Key::CMX} =  1, 
\par
\hyperlink{namespaceDfiFile_1_1Key_3918a3589fc86f5f216e37b2f184c15b6a5a84877c69c130c987baa8f758fafe}{DfiFile::Key::NONE} =  7
 \}
\begin{CompactList}\small\item\em The enumerates the 8 possible key types. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
\hypertarget{namespaceDfiFile_1_1Key_fce5b572c828ec1e0ca4f68729243087}{
unsigned int \hyperlink{namespaceDfiFile_1_1Key_fce5b572c828ec1e0ca4f68729243087}{DfiFile::Key::type} (unsigned int key)}
\label{namespaceDfiFile_1_1Key_fce5b572c828ec1e0ca4f68729243087}

\begin{CompactList}\small\item\em Returns the key type. \item\end{CompactList}\item 
\hypertarget{namespaceDfiFile_1_1Key_f94de3edc6c7a999e25080874cbcfb96}{
unsigned int \hyperlink{namespaceDfiFile_1_1Key_f94de3edc6c7a999e25080874cbcfb96}{DfiFile::Key::user} (unsigned int key)}
\label{namespaceDfiFile_1_1Key_f94de3edc6c7a999e25080874cbcfb96}

\begin{CompactList}\small\item\em Returns the user field. The interpretation of this field is dependent of the file the key is describing. \item\end{CompactList}\item 
\hypertarget{namespaceDfiFile_1_1Key_f49856a28d8ac8f11ba65ef0be57729a}{
unsigned int \hyperlink{namespaceDfiFile_1_1Key_f49856a28d8ac8f11ba65ef0be57729a}{DfiFile::Key::value} (unsigned int key)}
\label{namespaceDfiFile_1_1Key_f49856a28d8ac8f11ba65ef0be57729a}

\begin{CompactList}\small\item\em Returns the value of the key. For the FMX keys, this is just its value field, for all other keys it is the full key. This function is generally used by DFI to return the key to the user when he is expecting an FMX key and does not wish to deal with the user or type fields. \item\end{CompactList}\item 
\hypertarget{namespaceDfiFile_1_1KeyFmx_7947345d907f40221b9eff987d7277ef}{
unsigned int \hyperlink{namespaceDfiFile_1_1KeyFmx_7947345d907f40221b9eff987d7277ef}{DfiFile::KeyFmx::type} (unsigned int key)}
\label{namespaceDfiFile_1_1KeyFmx_7947345d907f40221b9eff987d7277ef}

\begin{CompactList}\small\item\em Return the FMX key type. This had better be Type::FMX otherwise this key is not a FMX key. \item\end{CompactList}\item 
\hypertarget{namespaceDfiFile_1_1KeyFmx_4147000fe6f29b891de73dd4e22cfdeb}{
unsigned int \hyperlink{namespaceDfiFile_1_1KeyFmx_4147000fe6f29b891de73dd4e22cfdeb}{DfiFile::KeyFmx::user} (unsigned int key)}
\label{namespaceDfiFile_1_1KeyFmx_4147000fe6f29b891de73dd4e22cfdeb}

\begin{CompactList}\small\item\em Returns the user field of an FMX key. \item\end{CompactList}\item 
\hypertarget{namespaceDfiFile_1_1KeyFmx_3be1b46e868320e6a77433319c3c95f3}{
unsigned int \hyperlink{namespaceDfiFile_1_1KeyFmx_3be1b46e868320e6a77433319c3c95f3}{DfiFile::KeyFmx::value} (unsigned int key)}
\label{namespaceDfiFile_1_1KeyFmx_3be1b46e868320e6a77433319c3c95f3}

\begin{CompactList}\small\item\em Returns the FMX file key portion of the full key. \item\end{CompactList}\item 
\hypertarget{namespaceDfiFile_1_1KeyFmx_11c8aff231a681ffebfecbc06d79c6f8}{
unsigned int \hyperlink{namespaceDfiFile_1_1KeyFmx_11c8aff231a681ffebfecbc06d79c6f8}{DfiFile::KeyFmx::error} (unsigned int key)}
\label{namespaceDfiFile_1_1KeyFmx_11c8aff231a681ffebfecbc06d79c6f8}

\begin{CompactList}\small\item\em Returns the must be zero fields. If these are not zero the key is in error. \item\end{CompactList}\item 
\hypertarget{namespaceDfiFile_1_1KeyCmx_e505209607e207ca861da229b34a3c5b}{
unsigned int \hyperlink{namespaceDfiFile_1_1KeyCmx_e505209607e207ca861da229b34a3c5b}{DfiFile::KeyCmx::type} (unsigned int key)}
\label{namespaceDfiFile_1_1KeyCmx_e505209607e207ca861da229b34a3c5b}

\begin{CompactList}\small\item\em Returns the CMX key type. This had better be Type::CMX otherwise this key is not a CMX key. \item\end{CompactList}\item 
\hypertarget{namespaceDfiFile_1_1KeyCmx_f199bcbe0f45e7a338b229078d0ba386}{
unsigned int \hyperlink{namespaceDfiFile_1_1KeyCmx_f199bcbe0f45e7a338b229078d0ba386}{DfiFile::KeyCmx::user} (unsigned int key)}
\label{namespaceDfiFile_1_1KeyCmx_f199bcbe0f45e7a338b229078d0ba386}

\begin{CompactList}\small\item\em Returns the user field of a CMX key. \item\end{CompactList}\item 
\hypertarget{namespaceDfiFile_1_1KeyCmx_906c3cad722116b8bac94e2d31677dd0}{
unsigned int \textbf{DfiFile::KeyCmx::value} (unsigned int key)}
\label{namespaceDfiFile_1_1KeyCmx_906c3cad722116b8bac94e2d31677dd0}

\item 
\hypertarget{namespaceDfiFile_1_1KeyCmx_594642833b4316974c78e686aef54174}{
unsigned int \hyperlink{namespaceDfiFile_1_1KeyCmx_594642833b4316974c78e686aef54174}{DfiFile::KeyCmx::patch} (unsigned int key)}
\label{namespaceDfiFile_1_1KeyCmx_594642833b4316974c78e686aef54174}

\begin{CompactList}\small\item\em Returns the patch number of a CMX key. \item\end{CompactList}\item 
\hypertarget{namespaceDfiFile_1_1KeyCmx_5456520de5e2de688da770a57039f425}{
unsigned int \hyperlink{namespaceDfiFile_1_1KeyCmx_5456520de5e2de688da770a57039f425}{DfiFile::KeyCmx::minor} (unsigned int key)}
\label{namespaceDfiFile_1_1KeyCmx_5456520de5e2de688da770a57039f425}

\begin{CompactList}\small\item\em Returns the minor version number of a CMX key. \item\end{CompactList}\item 
\hypertarget{namespaceDfiFile_1_1KeyCmx_9160ad9ca59e8ee4ace8ffc80c2c0e69}{
unsigned int \hyperlink{namespaceDfiFile_1_1KeyCmx_9160ad9ca59e8ee4ace8ffc80c2c0e69}{DfiFile::KeyCmx::major} (unsigned int key)}
\label{namespaceDfiFile_1_1KeyCmx_9160ad9ca59e8ee4ace8ffc80c2c0e69}

\begin{CompactList}\small\item\em Returns the major version number of a CMX key. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Layout and access for file keys. 

\begin{Desc}
\item[Author:]JJRussell - \href{mailto:russell@slac.stanford.edu}{\tt russell@slac.stanford.edu}\end{Desc}


\footnotesize\begin{verbatim}

   CVS $Id: DfiFile-Key.hh,v 1.1 2009/06/19 20:45:24 russell Exp $
\end{verbatim}
\normalsize


Routines to access the file keys stored in the datagrams. Mainly this was added to strip away the extra information stored in the upper 8-bits of FMX-style keys (uninteresting and an nuisance to DFI customers) but not strip them for CMX-style keys. (CMX-style keys are used in testing and should never appear in LAT-produced datagrams. There are used by developers to test new configurations, solving the chicken-and-egg problem of you can't commit a new configuration file until you test it, you can't test it till you get a new key and you can't get a new key until you commit it. As such, CMX-style keys are only of interest to developers.) 