\hypertarget{Dfi-CheckMacros_8hh}{
\section{Dfi-Check\-Macros.hh File Reference}
\label{Dfi-CheckMacros_8hh}\index{Dfi-CheckMacros.hh@{Dfi-CheckMacros.hh}}
}
Defines a set of macros which checks consistency between Q-defined structures and their DFI equivalents. 

{\tt \#include \char`\"{}PBI/Check.h\char`\"{}}\par


Include dependency graph for Dfi-Check\-Macros.hh:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=136pt]{Dfi-CheckMacros_8hh__incl}
\end{center}
\end{figure}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{Dfi-CheckMacros_8hh_a0}{
\#define {\bf offsetof}(c, m)~((unsigned int)\&(((c$\ast$)1) $\rightarrow$ m)-1)}
\label{Dfi-CheckMacros_8hh_a0}

\item 
\hypertarget{Dfi-CheckMacros_8hh_a1}{
\#define {\bf size\_\-of}(c, m)~sizeof (((c$\ast$)1) $\rightarrow$ m)}
\label{Dfi-CheckMacros_8hh_a1}

\item 
\hypertarget{Dfi-CheckMacros_8hh_a2}{
\#define {\bf Check\_\-Size}(\_\-class, \_\-struct)~CHECK(Size\_\- \#\# \_\-class, (sizeof(\_\-class) == sizeof (\_\-struct)))}
\label{Dfi-CheckMacros_8hh_a2}

\item 
\#define {\bf CONDITION}(\_\-class, \_\-struct, \_\-member)
\item 
\#define {\bf CONDITION2}(\_\-class, \_\-cmember, \_\-struct, \_\-smember)
\end{CompactItemize}


\subsection{Detailed Description}
Defines a set of macros which checks consistency between Q-defined structures and their DFI equivalents. 

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


\footnotesize\begin{verbatim}   CVS $Id: Dfi-CheckMacros.hh,v 1.1 2008/04/03 15:21:51 russell Exp $
\end{verbatim}
\normalsize


\begin{Desc}
\item[]The rules of the game are the DFI is allowed to import and use Q-defined data structures, but they are not allowed to export them. In practice this means Q include file may be used in the {\em src\/} directory but not the {\em DFI/\/} directory. In some cases, it is convenient to export the these structures. To do this consistent with the above rules, one is obligated to replicate the Q structure in DFI. The macros definied in here help to some large measure to ensure the replication is faithful. They can be used to check the sizes and offsets of field members is the same between the two. The one thing it cannot do is to ensure bit field structures are laid out consistently. Let the buyer beware.\end{Desc}


\subsection{Define Documentation}
\hypertarget{Dfi-CheckMacros_8hh_a3}{
\index{Dfi-CheckMacros.hh@{Dfi-Check\-Macros.hh}!CONDITION@{CONDITION}}
\index{CONDITION@{CONDITION}!Dfi-CheckMacros.hh@{Dfi-Check\-Macros.hh}}
\subsubsection[CONDITION]{\setlength{\rightskip}{0pt plus 5cm}\#define CONDITION(\_\-class, \_\-struct, \_\-member)}}
\label{Dfi-CheckMacros_8hh_a3}


{\bf Value:}

\footnotesize\begin{verbatim}((offsetof(_class, _member) ==  offsetof(_struct, _member)     \
  && (size_of (_class, _member) ==  size_of (_struct, _member))))
\end{verbatim}\normalsize 
\hypertarget{Dfi-CheckMacros_8hh_a4}{
\index{Dfi-CheckMacros.hh@{Dfi-Check\-Macros.hh}!CONDITION2@{CONDITION2}}
\index{CONDITION2@{CONDITION2}!Dfi-CheckMacros.hh@{Dfi-Check\-Macros.hh}}
\subsubsection[CONDITION2]{\setlength{\rightskip}{0pt plus 5cm}\#define CONDITION2(\_\-class, \_\-cmember, \_\-struct, \_\-smember)}}
\label{Dfi-CheckMacros_8hh_a4}


{\bf Value:}

\footnotesize\begin{verbatim}((offsetof(_class, _cmember) ==  offsetof(_struct, _smember)    \
  && (size_of (_class, _cmember) ==  size_of (_struct, _smember))))
\end{verbatim}\normalsize 
