📄 classsyncclient.tex
字号:
\section{SyncClient Class Reference}\label{classSyncClient}\index{SyncClient@{SyncClient}}This class wraps the common operations executed by a typical client. {\tt \#include $<$SyncClient.h$>$}Collaboration diagram for SyncClient:\nopagebreak\begin{figure}[H]\begin{center}\leavevmode\includegraphics[width=72pt]{classSyncClient__coll__graph}\end{center}\end{figure}\subsection*{Public Member Functions}\begin{CompactItemize}\item virtual int \textbf{sync} ({\bf SyncManagerConfig} \&config, {\bf SyncSource} $\ast$$\ast$sources)\label{classSyncClient_44c017d634e6bb1d7e49456d0268620f}\item virtual int {\bf sync} ({\bf SyncManagerConfig} \&config, char $\ast$$\ast$sourceNames=NULL)\begin{CompactList}\small\item\em Execute a synchronization with sources that are chosen based on the sourceNames param or, if sourceNames is NULL, based on the configuration: in this case all available sources will be used. \item\end{CompactList}\item {\bf SyncReport} $\ast$ \textbf{getSyncReport} ()\label{classSyncClient_03bdc4bb53a0f27431c363bdffd6f1b2}\end{CompactItemize}\subsection*{Protected Member Functions}\begin{CompactItemize}\item virtual int {\bf prepareSync} ({\bf SyncManagerConfig} \&config)\begin{CompactList}\small\item\em A callback into a derived class which is called after reading the SyncML configuration and before creating sources. \item\end{CompactList}\item virtual int {\bf createSyncSource} (const char $\ast$name, const int pos, {\bf SyncSourceConfig} $\ast$config, {\bf SyncSource} $\ast$$\ast$source)\begin{CompactList}\small\item\em A factory method that is used by the sync() call to create the sync sources that are to be synchronized. \item\end{CompactList}\item virtual int {\bf beginSync} ({\bf SyncSource} $\ast$$\ast$source)\begin{CompactList}\small\item\em Callback invoked after creating all sources. \item\end{CompactList}\item virtual int {\bf endSync} ({\bf SyncSource} $\ast$$\ast$source)\begin{CompactList}\small\item\em Callback invoked after the sync process. \item\end{CompactList}\item virtual int {\bf continueAfterPrepareSync} ()\begin{CompactList}\small\item\em Callback invoked after the prepareSync function. \item\end{CompactList}\item virtual int {\bf continueAfterSync} ()\begin{CompactList}\small\item\em Callback invoked after the sync function. \item\end{CompactList}\end{CompactItemize}\subsection*{Protected Attributes}\begin{CompactItemize}\item {\bf SyncReport} \textbf{syncReport}\label{classSyncClient_b9c9bd5497a43fdb2441a6c6a4c53b69}\end{CompactItemize}\subsection{Detailed Description}This class wraps the common operations executed by a typical client. It contains default implementations for calls invoked by the library core to parameterize or control the synchronization. A client can override these calls by subclassing \doxyref{SyncClient}{p.}{classSyncClient} and using an instance of its own class instead.Warning: the library contains global data in several different places. Therefore it is not possible to execute multiple sessions in parallel. \subsection{Member Function Documentation}\index{SyncClient@{SyncClient}!sync@{sync}}\index{sync@{sync}!SyncClient@{SyncClient}}\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual int SyncClient::sync ({\bf SyncManagerConfig} \& {\em config}, char $\ast$$\ast$ {\em sourceNames} = {\tt NULL})\hspace{0.3cm}{\tt [virtual]}}\label{classSyncClient_f036ed79954fa399321190bcb4836c35}Execute a synchronization with sources that are chosen based on the sourceNames param or, if sourceNames is NULL, based on the configuration: in this case all available sources will be used. \begin{itemize}\item calls \doxyref{prepareSync()}{p.}{classSyncClient_9879081b106e25299ab2fb76f1910734} to give a derived class the chance to setup syncing and get ready for creating sources\item iterates over sources to sync, asks for the corresponding client source with createSource()\item calls \doxyref{beginSync()}{p.}{classSyncClient_3b4b16eab6aa581b77c1749992f6e0e1} to give the derived class a class to do after all sources have been configured successfully\item executes the synchronization: call sync(sources$\ast$$\ast$)\end{itemize}This version of the call is easier to use for clients whose sync sources are determined by the configuration or by an array of desired sources to sync\begin{Desc}\item[Parameters:]\begin{description}\item[{\em config,:}]the configuration to be used for this sync \item[{\em sourceNames,:}]optional, a NULL terminated array of source names that we want to sync. If NULL, sources to sync are chosen from the configuration. \end{description}\end{Desc}\begin{Desc}\item[Returns:]0 on success, an error otherwise \end{Desc}\index{SyncClient@{SyncClient}!prepareSync@{prepareSync}}\index{prepareSync@{prepareSync}!SyncClient@{SyncClient}}\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual int SyncClient::prepareSync ({\bf SyncManagerConfig} \& {\em config})\hspace{0.3cm}{\tt [inline, protected, virtual]}}\label{classSyncClient_9879081b106e25299ab2fb76f1910734}A callback into a derived class which is called after reading the SyncML configuration and before creating sources. Not used by the sync(SyncSource$\ast$$\ast$) call.\begin{Desc}\item[Parameters:]\begin{description}\item[{\em config}]a reference to \doxyref{SyncManager}{p.}{classSyncManager} configuration can be used to read client specific properties \end{description}\end{Desc}\begin{Desc}\item[Returns:]0 for success, an error code otherwise - an error code aborts the whole synchronization \end{Desc}\index{SyncClient@{SyncClient}!createSyncSource@{createSyncSource}}\index{createSyncSource@{createSyncSource}!SyncClient@{SyncClient}}\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual int SyncClient::createSyncSource (const char $\ast$ {\em name}, const int {\em pos}, {\bf SyncSourceConfig} $\ast$ {\em config}, {\bf SyncSource} $\ast$$\ast$ {\em source})\hspace{0.3cm}{\tt [inline, protected, virtual]}}\label{classSyncClient_36b7aaed92c4ffdbd736656d0d3b9c10}A factory method that is used by the sync() call to create the sync sources that are to be synchronized. Not used by the sync(SyncSource$\ast$$\ast$) call.\begin{Desc}\item[Parameters:]\begin{description}\item[{\em name}]name of the sync source \item[{\em pos}]position of the \doxyref{SyncSource}{p.}{classSyncSource} in the SSConfig array (index: 0 - numSources-1) \item[{\em config}]a pointer to the source's configuration: this includes all properties that the client library knows and uses itself (only valid during this call) This pointer is owned by \doxyref{SyncManagerConfig}{p.}{classSyncManagerConfig}, sources uses it to initialize the internal config by reference. \end{description}\end{Desc}\begin{Desc}\item[Return values:]\begin{description}\item[{\em source}]the sync source created by the client or NULL if there is no sync source currently associated with the config or it is inactive; instance is a new SyncSource$\ast$ and it's freed by the caller (see finally) \end{description}\end{Desc}\begin{Desc}\item[Returns:]0 for success, an error code otherwise - an error code aborts the whole synchronization and the value of $\ast$source is ignored \end{Desc}\index{SyncClient@{SyncClient}!beginSync@{beginSync}}\index{beginSync@{beginSync}!SyncClient@{SyncClient}}\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual int SyncClient::beginSync ({\bf SyncSource} $\ast$$\ast$ {\em source})\hspace{0.3cm}{\tt [inline, protected, virtual]}}\label{classSyncClient_3b4b16eab6aa581b77c1749992f6e0e1}Callback invoked after creating all sources. \begin{Desc}\item[Returns:]0 for success, an error code otherwise - an error code stops immediately \end{Desc}\index{SyncClient@{SyncClient}!endSync@{endSync}}\index{endSync@{endSync}!SyncClient@{SyncClient}}\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual int SyncClient::endSync ({\bf SyncSource} $\ast$$\ast$ {\em source})\hspace{0.3cm}{\tt [inline, protected, virtual]}}\label{classSyncClient_8c0f42f529b29a89f9485dc3b3667f25}Callback invoked after the sync process. \begin{Desc}\item[Returns:]: 0 for success, an error code otherwise \end{Desc}\index{SyncClient@{SyncClient}!continueAfterPrepareSync@{continueAfterPrepareSync}}\index{continueAfterPrepareSync@{continueAfterPrepareSync}!SyncClient@{SyncClient}}\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual int SyncClient::continueAfterPrepareSync ()\hspace{0.3cm}{\tt [inline, protected, virtual]}}\label{classSyncClient_3b79e33ce147b673dbce1aaad99ab5e0}Callback invoked after the prepareSync function. \begin{Desc}\item[Returns:]0 for success, an error code otherwise - an error code stops immediately \end{Desc}\index{SyncClient@{SyncClient}!continueAfterSync@{continueAfterSync}}\index{continueAfterSync@{continueAfterSync}!SyncClient@{SyncClient}}\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual int SyncClient::continueAfterSync ()\hspace{0.3cm}{\tt [inline, protected, virtual]}}\label{classSyncClient_8c3fc3890d4f865a7c011fd6781bac90}Callback invoked after the sync function. \begin{Desc}\item[Returns:]: 0 for success, an error code otherwise \end{Desc}The documentation for this class was generated from the following file:\begin{CompactItemize}\item src/include/common/client/SyncClient.h\end{CompactItemize}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -