Couchbase Transactions C++ Client
1.0.0
Transactions client for couchbase
|
Exposes bucket-level operations and collections accessors. More...
#include <bucket.hxx>
Public Member Functions | |
CB_NODISCARD std::shared_ptr< class collection > | default_collection () |
CB_NODISCARD std::shared_ptr< class collection > | collection (const std::string &name) |
Get a collection by name. More... | |
CB_NODISCARD const std::string & | name () const |
Get collection name. More... | |
void | close () |
Close connection to this bucket. More... | |
~bucket () | |
Destroy the bucket. More... | |
CB_NODISCARD size_t | max_instances () const |
return maximum number of libcouchbase instances this bucket can use More... | |
CB_NODISCARD size_t | instances () const |
return current number of libcouchbase instances the cluster has created. More... | |
CB_NODISCARD size_t | available_instances () const |
return the current number of libcouchbase instances that are not being used. More... | |
CB_NODISCARD std::chrono::microseconds | default_kv_timeout () const |
return default kv timeout More... | |
CB_NODISCARD bool | operator== (const bucket &b) const |
Friends | |
class | collection |
class | cluster |
template<typename OStream > | |
OStream & | operator<< (OStream &os, const bucket &b) |
convienence method to allow outputtng information about the bucket to an ostream or similar. | |
Exposes bucket-level operations and collections accessors.
couchbase::bucket::~bucket | ( | ) |
Destroy the bucket.
Calls close(), which disconnects the bucket from the cluster, then destroys the object.
CB_NODISCARD size_t couchbase::bucket::available_instances | ( | ) | const |
return the current number of libcouchbase instances that are not being used.
void couchbase::bucket::close | ( | ) |
Close connection to this bucket.
Once you call this, this object will no longer be connected to the cluster. This means any collection objects created from this bucket (all of whom share this connection) will also not be connected. Called in destructor, but here in case you one needs it
CB_NODISCARD std::shared_ptr<class collection> couchbase::bucket::collection | ( | const std::string & | name | ) |
Get a collection by name.
name | of an existing collection in this bucket. |
CB_NODISCARD std::shared_ptr<class collection> couchbase::bucket::default_collection | ( | ) |
Get the default collection for this bucket
CB_NODISCARD std::chrono::microseconds couchbase::bucket::default_kv_timeout | ( | ) | const |
return default kv timeout
CB_NODISCARD size_t couchbase::bucket::instances | ( | ) | const |
return current number of libcouchbase instances the cluster has created.
CB_NODISCARD size_t couchbase::bucket::max_instances | ( | ) | const |
return maximum number of libcouchbase instances this bucket can use
The bucket maintains a pool of instances, lazily created, which it uses to communicate with the server. Each instance will maintain a number of socket connections. Any cluster calls that need an instance will use one, making it unavailable until the call is done with it. See cluster_options to set this value, which the cluster uses when it creates the bucket.
|
inline |
Get collection name.
Return the collection name.