kpilot/lib
SyncAction::SyncMode Class Reference
#include <syncAction.h>
Detailed Description
This class encapsulates the different sync modes that can be used, and enforces a little discipline in changing the mode and messing around in general.It replaces a simple enum by not much more, but it makes things like local test backups less likely to happen.
Note that this could all be packed into a bitfield (5 bits needed) but that makes for messy code in the end.
Definition at line 191 of file syncAction.h.
Public Types | |
enum | Mode { eHotSync = 1, eFullSync = 2, eCopyPCToHH = 3, eCopyHHToPC = 4, eBackup = 5, eRestore = 6 } |
Public Member Functions | |
SyncMode (Mode m, bool test=false, bool local=false) | |
SyncMode (const QStringList &l) | |
Mode | mode () const |
bool | setMode (int) |
bool | setMode (Mode m) |
bool | setOptions (bool test, bool local) |
bool | operator== (const Mode &m) const |
bool | operator== (const SyncMode &m) const |
bool | isTest () const |
bool | isLocal () const |
bool | isFullSync () const |
bool | isFirstSync () const |
bool | isSync () const |
bool | isCopy () const |
QString | name () const |
QStringList | list () const |
Static Public Member Functions | |
static QString | name (Mode) |
Member Enumeration Documentation
|
Available modes for the sync.
Definition at line 195 of file syncAction.h. |
Constructor & Destructor Documentation
|
Create a mode with the given Mode
Definition at line 160 of file syncAction.cc. |
|
Create a mode by parsing the string list. This is used mostly by the conduit proxies, which use a string list to pass aparameters to the shared library loader. Definition at line 137 of file syncAction.cc. |
Member Function Documentation
|
Classify every mode as either a sync (two-way) or copy (one-way) mode.
Definition at line 300 of file syncAction.h. |
|
Accessor for the local part of the mode. Local syncs use a local database instead of one on the device link. Definition at line 276 of file syncAction.h. |
|
Classify every mode as either a sync (two-way) or copy (one-way) mode.
Definition at line 293 of file syncAction.h. |
|
Accessor for the test part of the mode. Test syncs should never actually modify data anywhere. Definition at line 268 of file syncAction.h. |
|
Returns a QStringList that, when passed to the constructor of SyncMode, will re-create it. Used to pass modes into shared library factories. Definition at line 173 of file syncAction.cc. |
|
Returns the kind of sync; this is just incomplete information, since a test hot sync is very different from a non-test one.
Definition at line 222 of file syncAction.h. |
|
Returns a (human readable) name for this particular mode, including extra information about test and local mode.
Definition at line 214 of file syncAction.cc. |
|
Returns a standard name for each of the sync modes.
Definition at line 200 of file syncAction.cc. |
|
Longhand comparison. Compares two modes for the same mode enum and mixins local and test. Definition at line 258 of file syncAction.h. |
|
Shorthand to test for a specific mode enum. This disregards the mixings local and test. Definition at line 251 of file syncAction.h. |
|
Sets a mode from a This leaves the options unchanged, so as to reward properly-typed programming. Definition at line 247 of file syncAction.cc. |
|
Sets a mode from an integer
If the Definition at line 229 of file syncAction.cc. |
|
Sets options. Returns false if the combination of mode and the options is impossible. Definition at line 241 of file syncAction.h. |
The documentation for this class was generated from the following files: