Couchbase Transactions C++ Client
1.0.0
Transactions client for couchbase
|
Encapsulates results of an individual transaction operation. More...
#include <transaction_get_result.hxx>
Public Member Functions | |
transaction_get_result (const transaction_get_result &doc) | |
template<typename Content > | |
transaction_get_result (std::string id, Content content, uint64_t cas, collection &collection, transaction_links links, boost::optional< document_metadata > metadata) | |
template<typename Content > | |
transaction_get_result & | operator= (const transaction_get_result &other) |
CB_NODISCARD collection & | collection_ref () |
Collection that contains this document. More... | |
template<typename Content > | |
CB_NODISCARD Content | content () const |
Content of the document. More... | |
CB_NODISCARD const std::string & | id () const |
Get document id. More... | |
CB_NODISCARD uint64_t | cas () const |
Get document CAS. More... | |
CB_NODISCARD transaction_links | links () const |
template<typename Content > | |
void | content (const Content &content) |
Set content for this document. More... | |
void | cas (uint64_t cas) |
Set document CAS. More... | |
CB_NODISCARD const boost::optional< document_metadata > & | metadata () const |
Get document metadata. More... | |
Static Public Member Functions | |
template<typename Content > | |
static transaction_get_result | create_from (transaction_get_result &document, Content content) |
static transaction_get_result | create_from (collection &collection, std::string id, result res) |
Friends | |
template<typename OStream > | |
OStream & | operator<< (OStream &os, const transaction_get_result document) |
Encapsulates results of an individual transaction operation.
|
inline |
|
inline |
|
inline |
Get document CAS.
|
inline |
Set document CAS.
cas | desired CAS for document. |
|
inline |
Collection that contains this document.
|
inline |
Content of the document.
The content of the document is stored as json. That is represented internally as a nlohmann::json object. If the documents have a c++ class that represents them, it can be returned here by adding a to_json and from_json helper.
Then, you can do:
See examples/game_server, and for more detail https://github.com/nlohmann/json#arbitrary-types-conversions
|
inline |
Set content for this document.
content | the desired content. See content() for more details. |
|
inlinestatic |
|
inlinestatic |
|
inline |
Get document id.
|
inline |
|
inline |
Get document metadata.
|
inline |
|
friend |