Tkrzw
tkrzw::DBM::RecordProcessorCompareExchange Class Referencefinal

Record processor to implement DBM::CompareExchange. More...

#include <tkrzw_dbm.h>

Public Member Functions

 RecordProcessorCompareExchange (Status *status, std::string_view expected, std::string_view desired, std::string *actual, bool *found)
 Constructor.
 
std::string_view ProcessFull (std::string_view key, std::string_view value) override
 Processes an existing record.
 
std::string_view ProcessEmpty (std::string_view key) override
 Processes an empty record space.
 
- Public Member Functions inherited from tkrzw::DBM::RecordProcessor
virtual ~RecordProcessor ()=default
 Destructor.
 

Additional Inherited Members

- Static Public Attributes inherited from tkrzw::DBM::RecordProcessor
static const std::string_view NOOP
 The special string indicating no operation.
 
static const std::string_view REMOVE
 The special string indicating removing operation.
 

Detailed Description

Record processor to implement DBM::CompareExchange.

Constructor & Destructor Documentation

◆ RecordProcessorCompareExchange()

tkrzw::DBM::RecordProcessorCompareExchange::RecordProcessorCompareExchange ( Status * status,
std::string_view expected,
std::string_view desired,
std::string * actual,
bool * found )

Constructor.

Parameters
statusThe pointer to a status object to contain the result status.
expectedA string of the expected value.
desiredA string of the expected value.
actualThe pointer to a string object to contain the actual value. If it is nullptr, it is ignored.
foundThe pointer to a variable to contain whether there is an existing record. If it is nullptr, it is ignored.

Member Function Documentation

◆ ProcessFull()

std::string_view tkrzw::DBM::RecordProcessorCompareExchange::ProcessFull ( std::string_view key,
std::string_view value )
overridevirtual

Processes an existing record.

Reimplemented from tkrzw::DBM::RecordProcessor.

◆ ProcessEmpty()

std::string_view tkrzw::DBM::RecordProcessorCompareExchange::ProcessEmpty ( std::string_view key)
overridevirtual

Processes an empty record space.

Reimplemented from tkrzw::DBM::RecordProcessor.