⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 classsyncsource.tex

📁 This SDK allows to integrate a syncml stack in a C++ application on a variety of platforms. Current
💻 TEX
📖 第 1 页 / 共 2 页
字号:
\section{SyncSource Class Reference}\label{classSyncSource}\index{SyncSource@{SyncSource}}This is the main API that a SyncML client developer needs to implement to let the sync engine access the client's data.  {\tt \#include $<$SyncSource.h$>$}Inheritance diagram for SyncSource:\nopagebreak\begin{figure}[H]\begin{center}\leavevmode\includegraphics[width=75pt]{classSyncSource__inherit__graph}\end{center}\end{figure}Collaboration diagram for SyncSource:\nopagebreak\begin{figure}[H]\begin{center}\leavevmode\includegraphics[width=130pt]{classSyncSource__coll__graph}\end{center}\end{figure}\subsection*{Public Member Functions}\begin{CompactItemize}\item {\bf SyncSource} (const WCHAR $\ast$name, {\bf SyncSourceConfig} $\ast$sc) EXTRA\_\-SECTION\_\-01\begin{CompactList}\small\item\em Constructor: create a \doxyref{SyncSource}{p.}{classSyncSource} with the specified name. \item\end{CompactList}\item const WCHAR $\ast$ {\bf getName} () EXTRA\_\-SECTION\_\-01\begin{CompactList}\small\item\em Get the source name. \item\end{CompactList}\item const {\bf SyncSourceConfig} \& {\bf getConfig} () const EXTRA\_\-SECTION\_\-01\label{classSyncSource_780ae935e3489df91976e43b191de257}\begin{CompactList}\small\item\em read-only access to configuration \item\end{CompactList}\item {\bf SyncSourceConfig} \& {\bf getConfig} () EXTRA\_\-SECTION\_\-01\label{classSyncSource_bb8d82d173f4f4d484a039716847c24a}\begin{CompactList}\small\item\em read-write access to configuration \item\end{CompactList}\item {\bf SyncSourceReport} $\ast$ {\bf getReport} () EXTRA\_\-SECTION\_\-01\label{classSyncSource_109f3962b29f7ad033e12bfdbd2507af}\begin{CompactList}\small\item\em Return pointer to report object. \item\end{CompactList}\item void {\bf setReport} ({\bf SyncSourceReport} $\ast$sr) EXTRA\_\-SECTION\_\-01\begin{CompactList}\small\item\em Set the report pointer with the given one (no copy, only assign the pointer to the external one). \item\end{CompactList}\item SyncMode {\bf getPreferredSyncMode} () EXTRA\_\-SECTION\_\-01\begin{CompactList}\small\item\em Get \& Set the preferred synchronization mode for the \doxyref{SyncSource}{p.}{classSyncSource}. \item\end{CompactList}\item void \textbf{setPreferredSyncMode} (SyncMode syncMode) EXTRA\_\-SECTION\_\-01\label{classSyncSource_2560a3e22c9d05768fe24ebb812231ed}\item SyncMode {\bf getSyncMode} () EXTRA\_\-SECTION\_\-01\begin{CompactList}\small\item\em Get \& Sets the server imposed synchronization mode for the \doxyref{SyncSource}{p.}{classSyncSource}. \item\end{CompactList}\item void \textbf{setSyncMode} (SyncMode syncMode) EXTRA\_\-SECTION\_\-01\label{classSyncSource_c7f7e00a3633789941da0ba22fde8219}\item unsigned long {\bf getLastSync} () EXTRA\_\-SECTION\_\-01\begin{CompactList}\small\item\em Get \& Set the timestamp in milliseconds of the last synchronization. \item\end{CompactList}\item void \textbf{setLastSync} (unsigned long timestamp) EXTRA\_\-SECTION\_\-01\label{classSyncSource_43bc35184f10ecce2029483fcf68354b}\item unsigned long {\bf getNextSync} () EXTRA\_\-SECTION\_\-01\begin{CompactList}\small\item\em Gets \& Sets the timestamp in milliseconds of the next synchronization. \item\end{CompactList}\item void \textbf{setNextSync} (unsigned long timestamp) EXTRA\_\-SECTION\_\-01\label{classSyncSource_41684a8bbdeb8aebbc3a28c37dc4bc82}\item void {\bf setLastAnchor} (const char $\ast$last) EXTRA\_\-SECTION\_\-01\label{classSyncSource_f97853f652642c81cbf2db689b70700b}\begin{CompactList}\small\item\em Gets \& Sets the last anchor associated to the source. \item\end{CompactList}\item const char $\ast$ \textbf{getLastAnchor} () EXTRA\_\-SECTION\_\-01\label{classSyncSource_64171290943ddcaa9db87df2a9b583a4}\item const char $\ast$ {\bf getNextAnchor} () EXTRA\_\-SECTION\_\-01\label{classSyncSource_0c3297400e035a32f43ffd166b1833af}\begin{CompactList}\small\item\em Gets \& Sets the next anchor associated to the source. \item\end{CompactList}\item void \textbf{setNextAnchor} (const char $\ast$next) EXTRA\_\-SECTION\_\-01\label{classSyncSource_9251b157782c03cab2771f5a61c7dc1a}\item SourceFilter $\ast$ {\bf getFilter} ()\label{classSyncSource_3793f45147a6adb3004da8113ab988d3}\begin{CompactList}\small\item\em Gets filter. \item\end{CompactList}\item void {\bf setFilter} (SourceFilter $\ast$f)\begin{CompactList}\small\item\em Sets filter. \item\end{CompactList}\item virtual int {\bf beginSync} () EXTRA\_\-SECTION\_\-01\begin{CompactList}\small\item\em Called by the engine from inside SyncClient::sync() at the begin of the sync. \item\end{CompactList}\item virtual int {\bf endSync} () EXTRA\_\-SECTION\_\-01\begin{CompactList}\small\item\em Called by the engine from inside SyncClient::sync() at the end of the sync. \item\end{CompactList}\item virtual void {\bf setItemStatus} (const WCHAR $\ast$key, int status)=0EXTRA\_\-SECTION\_\-01\begin{CompactList}\small\item\em called by the sync engine with the status returned by the server for a certain item that the client sent to the server \item\end{CompactList}\item virtual SyncItem $\ast$ {\bf getFirstItemKey} ()=0EXTRA\_\-SECTION\_\-01\begin{CompactList}\small\item\em Return the key of the first SyncItem of all. \item\end{CompactList}\item virtual SyncItem $\ast$ {\bf getNextItemKey} ()=0EXTRA\_\-SECTION\_\-01\begin{CompactList}\small\item\em Return the key of the next SyncItem of all. \item\end{CompactList}\item virtual SyncItem $\ast$ {\bf getFirstItem} ()=0EXTRA\_\-SECTION\_\-01\begin{CompactList}\small\item\em Return the first SyncItem of all. \item\end{CompactList}\item virtual SyncItem $\ast$ {\bf getNextItem} ()=0EXTRA\_\-SECTION\_\-01\begin{CompactList}\small\item\em Return the next SyncItem of all. \item\end{CompactList}\item virtual SyncItem $\ast$ {\bf getFirstNewItem} ()=0EXTRA\_\-SECTION\_\-01\begin{CompactList}\small\item\em Return the first SyncItem of new one. \item\end{CompactList}\item virtual SyncItem $\ast$ {\bf getNextNewItem} ()=0EXTRA\_\-SECTION\_\-01\begin{CompactList}\small\item\em Return the next SyncItem of new one. \item\end{CompactList}\item virtual SyncItem $\ast$ {\bf getFirstUpdatedItem} ()=0EXTRA\_\-SECTION\_\-01\begin{CompactList}\small\item\em Return the first SyncItem of updated one. \item\end{CompactList}\item virtual SyncItem $\ast$ {\bf getNextUpdatedItem} ()=0EXTRA\_\-SECTION\_\-01\begin{CompactList}\small\item\em Return the next SyncItem of updated one. \item\end{CompactList}\item virtual SyncItem $\ast$ {\bf getFirstDeletedItem} ()=0EXTRA\_\-SECTION\_\-01\begin{CompactList}\small\item\em Return the first SyncItem of updated one. \item\end{CompactList}\item virtual SyncItem $\ast$ {\bf getNextDeletedItem} ()=0EXTRA\_\-SECTION\_\-01\begin{CompactList}\small\item\em Return the next SyncItem of updated one. \item\end{CompactList}\item virtual int {\bf addItem} (SyncItem \&item)=0EXTRA\_\-SECTION\_\-01\begin{CompactList}\small\item\em Called by the sync engine to add an item that the server has sent. \item\end{CompactList}\item virtual int {\bf updateItem} (SyncItem \&item)=0EXTRA\_\-SECTION\_\-01\begin{CompactList}\small\item\em Called by the sync engine to update an item that the source already should have. \item\end{CompactList}\item virtual int {\bf deleteItem} (SyncItem \&item)=0EXTRA\_\-SECTION\_\-01\begin{CompactList}\small\item\em Called by the sync engine to update an item that the source already should have. \item\end{CompactList}\item virtual ArrayElement $\ast$ {\bf clone} () EXTRA\_\-SECTION\_\-01=0\label{classSyncSource_923cf2f81617911decae0c8ecd527a17}\begin{CompactList}\small\item\em ArrayElement implementation. \item\end{CompactList}\end{CompactItemize}\subsection*{Protected Member Functions}\begin{CompactItemize}\item void {\bf assign} ({\bf SyncSource} \&s)\label{classSyncSource_63c3f4d089ad2e20b3c4bd11412e083a}\begin{CompactList}\small\item\em copies all elements, to be used by derived class' \doxyref{clone()}{p.}{classSyncSource_923cf2f81617911decae0c8ecd527a17} implementation \item\end{CompactList}\end{CompactItemize}\subsection*{Protected Attributes}\begin{CompactItemize}\item {\bf SyncSourceConfig} \& \textbf{config}\label{classSyncSource_115ba38b2b70c76a3a6791625011a5b9}\item {\bf SyncSourceReport} $\ast$ \textbf{report}\label{classSyncSource_688087e929eedb193de4b31c68d094d4}\end{CompactItemize}\subsection{Detailed Description}This is the main API that a SyncML client developer needs to implement to let the sync engine access the client's data. Each client may provide access to one or more sources. \subsection{Constructor \& Destructor Documentation}\index{SyncSource@{SyncSource}!SyncSource@{SyncSource}}\index{SyncSource@{SyncSource}!SyncSource@{SyncSource}}\subsubsection{\setlength{\rightskip}{0pt plus 5cm}SyncSource::SyncSource (const WCHAR $\ast$ {\em name}, {\bf SyncSourceConfig} $\ast$ {\em sc})}\label{classSyncSource_a9ee91bba46ead255bf25ff06784bf69}Constructor: create a \doxyref{SyncSource}{p.}{classSyncSource} with the specified name. \begin{Desc}\item[Parameters:]\begin{description}\item[{\em name}]the name of the \doxyref{SyncSource}{p.}{classSyncSource} \item[{\em sc}]configuration for the sync source: the instance must remain valid throughout the lifetime of the sync source because it keeps a reference to it and uses it as its own. A NULL pointer is allowed for unit testing outside of the sync framework; the sync source then references a global config instance to avoid crashes, but modifying that config will not make much sense. \end{description}\end{Desc}\subsection{Member Function Documentation}\index{SyncSource@{SyncSource}!getName@{getName}}\index{getName@{getName}!SyncSource@{SyncSource}}\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const WCHAR$\ast$ SyncSource::getName ()}\label{classSyncSource_9211291fff9b23689f362a4ac92456d7}Get the source name. \begin{Desc}\item[Returns:]- the source name (a pointer to the object buffer, will be released at object destruction) \end{Desc}\index{SyncSource@{SyncSource}!setReport@{setReport}}\index{setReport@{setReport}!SyncSource@{SyncSource}}\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void SyncSource::setReport ({\bf SyncSourceReport} $\ast$ {\em sr})}\label{classSyncSource_9c32ad493c710e45f95491d25af1cd6f}Set the report pointer with the given one (no copy, only assign the pointer to the external one). \begin{Desc}\item[Parameters:]\begin{description}\item[{\em sr}]the report for this sync source \end{description}\end{Desc}\index{SyncSource@{SyncSource}!getPreferredSyncMode@{getPreferredSyncMode}}\index{getPreferredSyncMode@{getPreferredSyncMode}!SyncSource@{SyncSource}}\subsubsection{\setlength{\rightskip}{0pt plus 5cm}SyncMode SyncSource::getPreferredSyncMode ()}\label{classSyncSource_3b84ade239d7c74a66941cdee7443ac4}Get \& Set the preferred synchronization mode for the \doxyref{SyncSource}{p.}{classSyncSource}. Taken initially from the configuration by setConfig(), it can then be modified by the client. The code synchronization code itself reads this value, but it doesn't modify it. \index{SyncSource@{SyncSource}!getSyncMode@{getSyncMode}}\index{getSyncMode@{getSyncMode}!SyncSource@{SyncSource}}\subsubsection{\setlength{\rightskip}{0pt plus 5cm}SyncMode SyncSource::getSyncMode ()}\label{classSyncSource_ce8ef908b97565021a4038595051b672}Get \& Sets the server imposed synchronization mode for the \doxyref{SyncSource}{p.}{classSyncSource}. Agreed upon with the server during the initial exchange with the server. The \doxyref{SyncSource}{p.}{classSyncSource} can react to it in \doxyref{beginSync()}{p.}{classSyncSource_17a63b0090b7c1fa3ab4508c93d24cac}, in particular it must wipe its local data during a refresh from server. \index{SyncSource@{SyncSource}!getLastSync@{getLastSync}}\index{getLastSync@{getLastSync}!SyncSource@{SyncSource}}\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned long SyncSource::getLastSync ()}\label{classSyncSource_beb8e35e9e0eda5870d863a9ad41fa1e}Get \& Set the timestamp in milliseconds of the last synchronization. The reference time of the timestamp is platform specific. \index{SyncSource@{SyncSource}!getNextSync@{getNextSync}}\index{getNextSync@{getNextSync}!SyncSource@{SyncSource}}\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned long SyncSource::getNextSync ()}\label{classSyncSource_df206c03290db612afbb5e08d697da18}Gets \& Sets the timestamp in milliseconds of the next synchronization. The reference time of the timestamp is platform specific. \index{SyncSource@{SyncSource}!setFilter@{setFilter}}\index{setFilter@{setFilter}!SyncSource@{SyncSource}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -