Uploaded image for project: 'Couchbase C client library libcouchbase'
  1. Couchbase C client library libcouchbase
  2. CCBC-1470

Access to C++ code from client code

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Known Error
    • Minor
    • None
    • None
    • None
    • None
    • 1

    Description

      We use Couchbase C client library from code written in C++ but it seems that public header files are C code. Is there a way to access C++ bits written in libcouchbase library, in particular the C++ class lcb_CMDSTORE (treated as opaque type from current header files as far as I can see). Reason for this is to eventually reduce memory allocations in following snippet code:

       

      lcb_CMDSTORE* scmd;

      // allocate lcb_CMDSTORE using new operator.
      lcb_cmdstore_create(&scmd, authoritative ? LCB_STORE_UPSERT : LCB_STORE_INSERT);

      // Key.

      // key value allocated and copied via std::string constructor. Would rather take a std::string&& and move data.
      lcb_cmdstore_key(scmd, id.data(), id.size());

      // Value.

      // Value allocated and copied via std::string constructor. Would rather take a std::string&& and move data.
      lcb_cmdstore_value(scmd, document.data(), document.size());

       

      Hope it makes sense, thanks in advance.

       

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              avsej Sergey Avseyev
              jo JC
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty