Elektra  0.8.26
Public Member Functions | List of all members
kdb::tools::merging::MergingKDB Class Reference

Provides a merging wrapper around a KDB instance. More...

#include <mergingkdb.hpp>

Inheritance diagram for kdb::tools::merging::MergingKDB:
Inheritance graph
[legend]
Collaboration diagram for kdb::tools::merging::MergingKDB:
Collaboration graph
[legend]

Public Member Functions

int get (KeySet &returned, std::string const &keyname) override
 Behaves like the KDB get function. More...
 
int get (KeySet &returned, Key &parentKey) override
 Behaves like the KDB get function. More...
 
virtual int synchronize (KeySet &returned, std::string const &keyname, ThreeWayMerge &merger)
 Synchronizes the file with the supplied KeySet. More...
 
virtual int synchronize (KeySet &returned, Key &parentKey, ThreeWayMerge &merger)
 If a conflict occurs during set, the supplied merger is used to resolve the conflict. More...
 
- Public Member Functions inherited from kdb::KDB
 KDB ()
 Constructs a class KDB. More...
 
 KDB (Key &errorKey)
 Constructs a class KDB. More...
 
virtual void open (Key &errorKey)
 Open the database. More...
 
virtual void close () throw ()
 Close the database. More...
 
virtual void close (Key &errorKey) throw ()
 Close the database. More...
 
virtual int set (KeySet &returned, std::string const &keyname)
 Set all keys below keyname. More...
 
virtual int set (KeySet &returned, Key &parentKey)
 Set all keys below parentKey. More...
 

Detailed Description

Provides a merging wrapper around a KDB instance.

The wrapper allows to pass a three way merger instance that is used to resolve conflicts during KDB set.

Member Function Documentation

◆ get() [1/2]

int kdb::tools::merging::MergingKDB::get ( KeySet returned,
std::string const &  keyname 
)
overridevirtual

Behaves like the KDB get function.

See also
KDB

Reimplemented from kdb::KDB.

◆ get() [2/2]

int kdb::tools::merging::MergingKDB::get ( KeySet returned,
Key parentKey 
)
overridevirtual

Behaves like the KDB get function.

See also
KDB

Reimplemented from kdb::KDB.

◆ synchronize() [1/2]

int kdb::tools::merging::MergingKDB::synchronize ( KeySet returned,
std::string const &  keyname,
ThreeWayMerge &  merger 
)
virtual

Synchronizes the file with the supplied KeySet.

If a conflict occurs during set, the supplied merger is used to resolve the conflict. If the conflict cannot be solved, an exception is thrown. If the KeySet was successfully written (either by merging or due the absence of a conflict) the supplied KeySet is updated with the new content of the file.

See also
KDB
Exceptions
MergingKDBException

◆ synchronize() [2/2]

int kdb::tools::merging::MergingKDB::synchronize ( KeySet returned,
Key parentKey,
ThreeWayMerge &  merger 
)
virtual

If a conflict occurs during set, the supplied merger is used to resolve the conflict.

If the conflict cannot be solved, an exception is thrown. If the KeySet was successfully written (either by merging or due the absence of a conflict) the supplied KeySet is updated with the new content of the file.

See also
KDB
Exceptions
MergingKDBException

The documentation for this class was generated from the following files: