Couchbase C++ SDK 1.0.4 (rev. 5355b0f)
Loading...
Searching...
No Matches
cas Class Reference

CAS is a special type that represented in protocol using unsigned 64-bit integer, but only equality checks allowed. More...

#include <couchbase/cas.hxx>

Public Member Functions

 cas ()=default
 Constructs empty CAS value.
 
 cas (std::uint64_t value)
 Constructs CAS value using its integer representation that typically comes from protocol level.
 
auto operator== (const cas &other) const -> bool
 Checks if CAS instances represent the same value.
 
auto operator!= (const cas &other) const -> bool
 Checks if CAS instances represent the same value.
 
auto empty () const -> bool
 Checks if CAS contains meaningful value.
 
auto value () const -> std::uint64_t
 Returns internal representation of the CAS value.
 

Detailed Description

CAS is a special type that represented in protocol using unsigned 64-bit integer, but only equality checks allowed.

The user should not interpret the integer value of the CAS.

Since
1.0.0
Committed
Generally available API and should be preferred in production
Examples
distributed_mutex.cxx.

Constructor & Destructor Documentation

◆ cas() [1/2]

cas ( )
default

Constructs empty CAS value.

Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ cas() [2/2]

cas ( std::uint64_t value)
inlineexplicit

Constructs CAS value using its integer representation that typically comes from protocol level.

Parameters
valuenumeric CAS representation
Since
1.0.0
Committed
Generally available API and should be preferred in production

Member Function Documentation

◆ empty()

auto empty ( ) const -> bool
inlinenodiscard

Checks if CAS contains meaningful value.

Returns
true if CAS is empty
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ operator!=()

auto operator!= ( const cas & other) const -> bool
inline

Checks if CAS instances represent the same value.

Parameters
otheranother CAS
Returns
true if CAS values don't represent the same value
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ operator==()

auto operator== ( const cas & other) const -> bool
inline

Checks if CAS instances represent the same value.

Parameters
other
Returns
true if CAS values represent the same value
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ value()

auto value ( ) const -> std::uint64_t
inlinenodiscard

Returns internal representation of the CAS value.

Returns
raw CAS value
Since
1.0.0
Internal
Internal interface

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