\label{t:cheaders}
\end{table}
+\subsubsection{Building Client Programs}
+The easiest way to build programs using the \LB library in C is to use
+GNU's libtool to take care of all the dependencies:
+\begin{verbatim}
+flavour=gcc32dbg
+libtool --mode=compile gcc -c example1.c util.c \
+ -I\$GLITE_LOCATION/include -D_GNU_SOURCE
+libtool --mode=link gcc -o example1 example1.o util.o \
+ -L$GLITE_LOCATION/lib -lglite_lb_client_$flavour
+\end{verbatim}
+The library comes in different flavours (with/without debugging
+symbols, with/without thread support) which are in turn linked with
+(and depend on) the correct Globus library flavours. When linking
+threaded programs you have to use the library flavour with thread
+support.
+
+The RPM package needed is \texttt{glite-lb-client} and its dependencies
+which contain all necessary libraries.
+
\subsubsection{Context}
\label{s:edg_wll_context}
\marginpar{Context initialization}%
For more information see file \verb'include/glite/lb/jobstat.h'
-\subsubsection{Building Client Programs}
-The easiest way to build programs using the \LB library in C is to use
-GNU's libtool to take care of all the dependencies:
-\begin{verbatim}
-flavour=gcc32dbg
-libtool --mode=compile gcc -c example1.c util.c \
- -I\$GLITE_LOCATION/include -D_GNU_SOURCE
-libtool --mode=link gcc -o example1 example1.o util.o \
- -L$GLITE_LOCATION/lib -lglite_lb_client_$flavour
-\end{verbatim}
-The library comes in different flavours (with/without debugging
-symbols, with/withou thread support) which in turn depend on the
-correct Globus library flavours.
-
-The package needed is \texttt{glite-lb-client} and its dependencies
-which contain all necessary libraries.
-
\subsection{C++ Language Binding}
The C++ languague binding now only supports the consumer (querying)
API. It is not the (re)implementation of the library in C++; instead
therefore part of the respective chapters.
\subsubsection{Header Files}
-Header files for the C++ version of common definitions are suummarized
-in table~\ref{t:cppheaders}
+Header files for the C++ version of common definitions are summarized
+in table~\ref{t:cppheaders}.
\begin{table}[h]
\begin{tabularx}{\textwidth}{>{\tt}lX}
glite/jobid/JobId.h & Definition of job identifier. \\
-glite/lb/CountRef.h & Reference counting class for encapsulated C structures.\\
glite/lb/LoggingExceptions.h & Exception class for \LB--specific errors.\\
\end{tabularx}
\caption{Header file for common C++ classes}
\end{table}
+\subsubsection{Building Programs}
+The recommended way to build programs using the C++ \LB library is,
+like in the C case, use the \verb'libtool' utility:
+\begin{verbatim}
+flavour=gcc32dbg
+libtool --mode=compile gcc -c example1.c util.c \
+ -I\$GLITE_LOCATION/include -D_GNU_SOURCE
+libtool --mode=link gcc -o example1 example1.o util.o \
+ -L$GLITE_LOCATION/lib -lglite_lb_clientpp_$flavour
+\end{verbatim}
+The only difference is the library name, the RPM package required is
+again \verb'glite-lb-client'.
+
\subsubsection{JobId}
The \verb'glite::jobid::JobId' class represents job identification and
provides convenient methods for manipulating the data. The
cout << "Complete jobid: " << a.toString() << endl;
\end{lstlisting}
-\subsubsection{Event}
-The objects of class \verb'glite::lb::Event' are returned by the \LB event
-queries. The \verb'Event' class introduces symbolic names for event attributes
-and their types, feature not available through the C API, as well as
-(read only) access to the attribute values. Using these methods you can
-\begin{itemize}
-\item get the event type (both symbolic and string),
-\begin{lstlisting}
- const std::string & name(void) const;
- static const std::string getEventName(Type type);
-\end{lstlisting}
-\item get the list of attribute types and values,
-\begin{lstlisting}
- const std::vector<std::pair<Attr,AttrType> > & getAttrs(void) const;
-\end{lstlisting}
-\item get string representation of attribute names,
-\begin{lstlisting}
- static const std::string & getAttrName(Attr name);
-\end{lstlisting}
-\item get value of given attribute.
+\subsubsection{Exception}
+The \verb'glite::lb::Exception' is a base class for all exceptions
+thrown by the \LB library. It inherits from \verb'std::runtime_error'
+and adds no additional members or methods except constructors:
\begin{lstlisting}
- int getValInt(Attr name) const;
- float getValFloat(Attr name) const;
- double getValDouble(Attr name) const;
- std::string getValString(Attr name) const;
- struct timeval getValTime(Attr name) const;
- const glite::jobid::JobId getValJobId(Attr name) const;
+try {
+} catch (glite::lb::Exception &e) {
+ cerr << "LB library exception: " << e.what() << endl;
+}
\end{lstlisting}
-\end{itemize}
-
-Following example demonstrates this by printing the event attributes:
-\lstinputlisting[title={\bf File: }\lstname,firstline=8,numbers=left]{util.C}
-
-\subsubsection{Building Programs}
\subsection{C++ Language Binding}
\TODO{michal}
+The querying C++ \LB API is modelled after the C \LB API using these basic principles:
+\begin{itemize}
+\item
+\end{itemize}
\subsubsection{Header Files}
+Header files for the \LB consumer API are summarized in table~\ref{t:ccppheaders}.
+\begin{table}[h]
+\begin{tabularx}{\textwidth}{>{\tt}lX}
+glite/lb/Event.h & \\
+glite/lb/ServerConnection.h & \\
+glite/lb/Job.h & \\
+glite/lb/JobStatus.h & \\
+
+\end{tabularx}
+\end{table}
+
+\subsubsection{QueryRecord}
+\subsubsection{Event}
+The objects of class \verb'glite::lb::Event' are returned by the \LB event
+queries. The \verb'Event' class introduces symbolic names for event attributes
+and their types, feature not available through the C API, as well as
+(read only) access to the attribute values. Using these methods you can
+\begin{itemize}
+\item get the event type (both symbolic and string),
+\begin{lstlisting}
+ const std::string & name(void) const;
+ static const std::string getEventName(Type type);
+\end{lstlisting}
+\item get the list of attribute types and values,
+\begin{lstlisting}
+ const std::vector<std::pair<Attr,AttrType> > & getAttrs(void) const;
+\end{lstlisting}
+\item get string representation of attribute names,
+\begin{lstlisting}
+ static const std::string & getAttrName(Attr name);
+\end{lstlisting}
+\item get value of given attribute.
+\begin{lstlisting}
+ int getValInt(Attr name) const;
+ float getValFloat(Attr name) const;
+ double getValDouble(Attr name) const;
+ std::string getValString(Attr name) const;
+ struct timeval getValTime(Attr name) const;
+ const glite::jobid::JobId getValJobId(Attr name) const;
+\end{lstlisting}
+\end{itemize}
+
+Following example demonstrates this by printing the event attributes:
+\lstinputlisting[title={\bf File: }\lstname,firstline=8,numbers=left]{util.C}
+
+\subsubsection{JobStatus}
\subsubsection{ServerConnection}\label{s:ServerConnection}
\subsubsection{Job}
-\subsubsection{JobStatus}
\subsection{Web-Services Binding}\label{s:Consumer-API-WS}