\hypertarget{TOV_8h}{
\section{TOV.h File Reference}
\label{TOV_8h}\index{TOV.h@{TOV.h}}
}
TimeOut Value definition and manipulation routines.  


{\tt \#include $<$IPBS/WCT.h$>$}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{TOV_8h_a6efc7ec874ed01f9b9d0ce314f091f5}{
\#define \hyperlink{TOV_8h_a6efc7ec874ed01f9b9d0ce314f091f5}{TOV\_\-K\_\-NSECS\_\-IN\_\-A\_\-SEC}~(1000 $\ast$ 1000 $\ast$ 1000)}
\label{TOV_8h_a6efc7ec874ed01f9b9d0ce314f091f5}

\begin{CompactList}\small\item\em Convenience symbol defining the number of nanoseconds in a second. \item\end{CompactList}\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
typedef \hyperlink{TOV_8h_8vx-xxx-xxx_3892d8eb40cbdd76345c0e4177fbf430}{TOV}($\ast$ \hyperlink{TOV_8h_e2333f8380ee66c994cd27844296cc76}{TOV\_\-cvt\_\-s} )(unsigned int delta)
\begin{CompactList}\small\item\em Signature of a function to convert a timeout value in arbitrary units (but known to the converter) to a TOV. \item\end{CompactList}\item 
typedef \hyperlink{TOV_8h_8vx-xxx-xxx_3892d8eb40cbdd76345c0e4177fbf430}{TOV}($\ast$ \hyperlink{TOV_8h_cb6f86a9d57b32a9a1848d950d21571f}{TOV\_\-cvt\_\-x} )(long long int delta)
\begin{CompactList}\small\item\em Signature of a function to convert a timeout value in arbitrary units (but known to the converter) to a TOV. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
\hyperlink{TOV_8h_8vx-xxx-xxx_3892d8eb40cbdd76345c0e4177fbf430}{TOV} \hyperlink{TOV_8h_ad6c21abbec0dfd3d8a27aa0131af69b}{TOV\_\-add\_\-nsecx} (\hyperlink{TOV_8h_8vx-xxx-xxx_3892d8eb40cbdd76345c0e4177fbf430}{TOV} tov, signed long long int dnsecx)
\begin{CompactList}\small\item\em Returns the timeout value {\em delta\/} nanoseconds from the specified {\em tov\/}. \item\end{CompactList}\item 
\hyperlink{TOV_8h_8vx-xxx-xxx_3892d8eb40cbdd76345c0e4177fbf430}{TOV} \hyperlink{TOV_8h_71df09e1aa0bc989b53b821e6deabb9f}{TOV\_\-add\_\-nsecs} (\hyperlink{TOV_8h_8vx-xxx-xxx_3892d8eb40cbdd76345c0e4177fbf430}{TOV} tov, unsigned int dnsecs)
\begin{CompactList}\small\item\em Returns the timeout value {\em delta\/} nanoseconds from the specified {\em tov\/}. \item\end{CompactList}\item 
\hyperlink{TOV_8h_8vx-xxx-xxx_3892d8eb40cbdd76345c0e4177fbf430}{TOV} \hyperlink{TOV_8h_23d4b5e8d3e89377150d5de37f879d03}{TOV\_\-from\_\-nsecx} (long long int dnsecx)
\begin{CompactList}\small\item\em Returns the timeout value {\em dsecx\/} nanoseconds from the current time. \item\end{CompactList}\item 
\hyperlink{TOV_8h_8vx-xxx-xxx_3892d8eb40cbdd76345c0e4177fbf430}{TOV} \hyperlink{TOV_8h_d769538fb1c86cca110de156aff73d40}{TOV\_\-from\_\-nsecs} (unsigned int dnsecs)
\begin{CompactList}\small\item\em Returns the timeout value {\em dnsecs\/} nanoseconds from the current time. \item\end{CompactList}\item 
\hyperlink{TOV_8h_8vx-xxx-xxx_3892d8eb40cbdd76345c0e4177fbf430}{TOV} \hyperlink{TOV_8h_951e4fd50697caa87f49ffa09741b893}{TOV\_\-from\_\-usecs} (unsigned int dusecs)
\begin{CompactList}\small\item\em Returns the timeout value {\em delta\/} microseconds from the current time. \item\end{CompactList}\item 
\hyperlink{TOV_8h_8vx-xxx-xxx_3892d8eb40cbdd76345c0e4177fbf430}{TOV} \hyperlink{TOV_8h_5135c3d4d393ec5b63d75f3dfe3b02c3}{TOV\_\-from\_\-secs} (unsigned int dsecs)
\begin{CompactList}\small\item\em Returns the timeout value {\em dsecs\/} seconds from the current time. \item\end{CompactList}\item 
\hyperlink{TOV_8h_8vx-xxx-xxx_3892d8eb40cbdd76345c0e4177fbf430}{TOV} \hyperlink{TOV_8h_ea77ae4b7ea117f92cd261a7110e6d50}{TOV\_\-from\_\-wct} (\hyperlink{WCT_8h_99ebc88268e494e2e0ee882677d8cc88}{WCT\_\-time} atime)
\begin{CompactList}\small\item\em Returns the timeout value corresponding to the specified Wall Clock Time {\em wct\/}. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
TimeOut Value definition and manipulation routines. 

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


\footnotesize\begin{verbatim}

    CVS $Id: TOV.h,v 1.2 2011/03/25 21:15:03 saxton Exp $
\end{verbatim}
\normalsize


Provides a set of utility functions to define a timeout time. The timeout is always given in terms of absolute time, but the exact specification is platform dependent. 

\subsection{Typedef Documentation}
\hypertarget{TOV_8h_e2333f8380ee66c994cd27844296cc76}{
\index{TOV.h@{TOV.h}!TOV\_\-cvt\_\-s@{TOV\_\-cvt\_\-s}}
\index{TOV\_\-cvt\_\-s@{TOV\_\-cvt\_\-s}!TOV.h@{TOV.h}}
\subsubsection[{TOV\_\-cvt\_\-s}]{\setlength{\rightskip}{0pt plus 5cm}{\bf TOV\_\-cvt\_\-s}}}
\label{TOV_8h_e2333f8380ee66c994cd27844296cc76}


Signature of a function to convert a timeout value in arbitrary units (but known to the converter) to a TOV. 

All timeouts must eventually be expressed as a TOV. The exact representation of this is platform dependent. Most code would like to specify a timeout in natural delta units, like seconds, micro-seconds, nano-seconds. A feature of a TOV is that, on some systems, it is an absolute time. Therefore, the conversion from a delta units to a TOV must be done when the blocking operation to be timed out is posted. That is, no cannot precompute the timeout value and store it for latter use. In this case, one stores the delta unit and a pointer to a function that can implement the conversion.

The timeout period to be converted is expressed as unsigned int. If a longer timeout period is needed, consider TOV\_\-cvt\_\-x, for the larger range, a 64-bit signed delta.

In most cases, the converter will be one of the TOV routines, although nothing prohibits the user from providing his own. \hypertarget{TOV_8h_cb6f86a9d57b32a9a1848d950d21571f}{
\index{TOV.h@{TOV.h}!TOV\_\-cvt\_\-x@{TOV\_\-cvt\_\-x}}
\index{TOV\_\-cvt\_\-x@{TOV\_\-cvt\_\-x}!TOV.h@{TOV.h}}
\subsubsection[{TOV\_\-cvt\_\-x}]{\setlength{\rightskip}{0pt plus 5cm}{\bf TOV\_\-cvt\_\-x}}}
\label{TOV_8h_cb6f86a9d57b32a9a1848d950d21571f}


Signature of a function to convert a timeout value in arbitrary units (but known to the converter) to a TOV. 

All timeouts must eventually be expressed as a TOV. The exact representation of this is platform dependent. Most code would like to specify a timeout in natural delta units, like seconds, micro-seconds, nano-seconds. A feature of a TOV is that, on some systems, it is an absolute time. Therefore, the conversion from a delta units to a TOV must be done when the blocking operation to be timed out is posted. That is, no cannot precompute the timeout value and store it for latter use. In this case, one stores the delta unit and a pointer to a function that can implement the conversion.

The timeout period to be converted is expressed as signed long long value. This is gives an extended range necessary for very long timeouts. If a smaller range is all that is necessary, consider TOV\_\-cvt\_\-s.

In most cases, the converter will be one of the TOV routines, although nothing prohibits the user from providing his own. 

\subsection{Function Documentation}
\hypertarget{TOV_8h_71df09e1aa0bc989b53b821e6deabb9f}{
\index{TOV.h@{TOV.h}!TOV\_\-add\_\-nsecs@{TOV\_\-add\_\-nsecs}}
\index{TOV\_\-add\_\-nsecs@{TOV\_\-add\_\-nsecs}!TOV.h@{TOV.h}}
\subsubsection[{TOV\_\-add\_\-nsecs}]{\setlength{\rightskip}{0pt plus 5cm}{\bf TOV} TOV\_\-add\_\-nsecs ({\bf TOV} {\em tov}, \/  unsigned int {\em dnsecs})}}
\label{TOV_8h_71df09e1aa0bc989b53b821e6deabb9f}


Returns the timeout value {\em delta\/} nanoseconds from the specified {\em tov\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em tov}]The TOV to add to \item[{\em dnsecs}]The number of nanoseconds to add. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em The}]timeout value delta nanoseconds from {\em tov\/}. \end{description}
\end{Desc}


References NSECS\_\-IN\_\-A\_\-SECOND, \_\-TOV\_\-u::tov, and \_\-TOV\_\-u::ts.\hypertarget{TOV_8h_ad6c21abbec0dfd3d8a27aa0131af69b}{
\index{TOV.h@{TOV.h}!TOV\_\-add\_\-nsecx@{TOV\_\-add\_\-nsecx}}
\index{TOV\_\-add\_\-nsecx@{TOV\_\-add\_\-nsecx}!TOV.h@{TOV.h}}
\subsubsection[{TOV\_\-add\_\-nsecx}]{\setlength{\rightskip}{0pt plus 5cm}{\bf TOV} TOV\_\-add\_\-nsecx ({\bf TOV} {\em tov}, \/  signed long long int {\em dnsecx})}}
\label{TOV_8h_ad6c21abbec0dfd3d8a27aa0131af69b}


Returns the timeout value {\em delta\/} nanoseconds from the specified {\em tov\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em tov}]The TOV to add to \item[{\em dnsecx}]The number of nanoseconds to add. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em The}]timeout value delta nanoseconds from {\em tov\/}. \end{description}
\end{Desc}


References NSECS\_\-IN\_\-A\_\-SECOND, \_\-TOV\_\-u::tov, and \_\-TOV\_\-u::ts.

Referenced by WUT\_\-keepalive\_\-rtn().\hypertarget{TOV_8h_d769538fb1c86cca110de156aff73d40}{
\index{TOV.h@{TOV.h}!TOV\_\-from\_\-nsecs@{TOV\_\-from\_\-nsecs}}
\index{TOV\_\-from\_\-nsecs@{TOV\_\-from\_\-nsecs}!TOV.h@{TOV.h}}
\subsubsection[{TOV\_\-from\_\-nsecs}]{\setlength{\rightskip}{0pt plus 5cm}{\bf TOV} TOV\_\-from\_\-nsecs (unsigned int {\em dnsecs})}}
\label{TOV_8h_d769538fb1c86cca110de156aff73d40}


Returns the timeout value {\em dnsecs\/} nanoseconds from the current time. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dnsecs}]The delta time in nanoseconds \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em The}]timeout value {\em dnsecs\/} nanoseconds from the current time. \end{description}
\end{Desc}


References \_\-TOV\_\-u::tov, \_\-TOV\_\-u::ts, and TSS\_\-nsecsTOtodAdd().

Referenced by TASK\_\-pause(), and WUT\_\-sys\_\-connect().\hypertarget{TOV_8h_23d4b5e8d3e89377150d5de37f879d03}{
\index{TOV.h@{TOV.h}!TOV\_\-from\_\-nsecx@{TOV\_\-from\_\-nsecx}}
\index{TOV\_\-from\_\-nsecx@{TOV\_\-from\_\-nsecx}!TOV.h@{TOV.h}}
\subsubsection[{TOV\_\-from\_\-nsecx}]{\setlength{\rightskip}{0pt plus 5cm}{\bf TOV} TOV\_\-from\_\-nsecx (long long int {\em dnsecx})}}
\label{TOV_8h_23d4b5e8d3e89377150d5de37f879d03}


Returns the timeout value {\em dsecx\/} nanoseconds from the current time. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dnsecx}]The delta time in extended nanoseconds. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em The}]timeout value delta nanoseconds from the current time. \end{description}
\end{Desc}


References \_\-TOV\_\-u::tov, \_\-TOV\_\-u::ts, and TSS\_\-nsecxTOtodAdd().\hypertarget{TOV_8h_5135c3d4d393ec5b63d75f3dfe3b02c3}{
\index{TOV.h@{TOV.h}!TOV\_\-from\_\-secs@{TOV\_\-from\_\-secs}}
\index{TOV\_\-from\_\-secs@{TOV\_\-from\_\-secs}!TOV.h@{TOV.h}}
\subsubsection[{TOV\_\-from\_\-secs}]{\setlength{\rightskip}{0pt plus 5cm}{\bf TOV} TOV\_\-from\_\-secs (unsigned int {\em dsecs})}}
\label{TOV_8h_5135c3d4d393ec5b63d75f3dfe3b02c3}


Returns the timeout value {\em dsecs\/} seconds from the current time. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dsecs}]The delta time in seconds. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em The}]timeout value {\em dsecs\/} seconds from the current time. \end{description}
\end{Desc}


References \_\-TOV\_\-u::tov, \_\-TOV\_\-u::ts, and TSS\_\-secsTOtodAdd().\hypertarget{TOV_8h_951e4fd50697caa87f49ffa09741b893}{
\index{TOV.h@{TOV.h}!TOV\_\-from\_\-usecs@{TOV\_\-from\_\-usecs}}
\index{TOV\_\-from\_\-usecs@{TOV\_\-from\_\-usecs}!TOV.h@{TOV.h}}
\subsubsection[{TOV\_\-from\_\-usecs}]{\setlength{\rightskip}{0pt plus 5cm}{\bf TOV} TOV\_\-from\_\-usecs (unsigned int {\em dusecs})}}
\label{TOV_8h_951e4fd50697caa87f49ffa09741b893}


Returns the timeout value {\em delta\/} microseconds from the current time. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dusecs}]The delta time in microseconds. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em The}]timeout value {\bf usecs} microseconds from the current time. \end{description}
\end{Desc}


References \_\-TOV\_\-u::tov, \_\-TOV\_\-u::ts, and TSS\_\-usecsTOtodAdd().\hypertarget{TOV_8h_ea77ae4b7ea117f92cd261a7110e6d50}{
\index{TOV.h@{TOV.h}!TOV\_\-from\_\-wct@{TOV\_\-from\_\-wct}}
\index{TOV\_\-from\_\-wct@{TOV\_\-from\_\-wct}!TOV.h@{TOV.h}}
\subsubsection[{TOV\_\-from\_\-wct}]{\setlength{\rightskip}{0pt plus 5cm}{\bf TOV} TOV\_\-from\_\-wct ({\bf WCT\_\-time} {\em wct})}}
\label{TOV_8h_ea77ae4b7ea117f92cd261a7110e6d50}


Returns the timeout value corresponding to the specified Wall Clock Time {\em wct\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em wct}]The Wall Clock Time to convert to a TOV. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em The}]corresponding TOV \end{description}
\end{Desc}


References \_\-TOV\_\-u::tov, \_\-TOV\_\-u::ts, TSS\_\-from\_\-wct(), and WCT\_\-K\_\-UTB\_\-OFFSET\_\-IN\_\-SECS.