MongoDB C++ Driver 4.2.0
Loading...
Searching...
No Matches
mongocxx::v_noabi::instance Class Reference

#include <mongocxx/v_noabi/mongocxx/instance.hpp>

Description

An instance of the MongoDB C++ Driver.

Attention
This feature is experimental! It is not ready for use!

All mongocxx API MUST be used within the lifetime of the instance object, with special exemptions listed below. Only ONE instance object may exist for the lifetime of a given process. It is undefined behavior to use the mongocxx API before the instance object is initialized or after the instance object is destroyed. It is undefined behavior to create more than one instance object.

int main() {
// ...
// MUST NOT call mongocxx API before this point.
{
// MAY call mongocxx API at this point.
// ...
}
// MUST NOT call mongocxx API after this point.
// ...
}
An instance of the MongoDB C++ Driver.
Definition instance.hpp:66
instance()
Creates an instance of the driver.
Special exemptions
Only the following API are permitted to be used outside the lifetime of an instance object:
See also

Public Member Functions

 instance ()
 Creates an instance of the driver.
 instance (instance &&other) noexcept
 Move constructs an instance of the driver.
 instance (instance const &)=delete
 This class is not copyable.
 instance (std::unique_ptr< v_noabi::logger > logger)
 Creates an instance of the driver with a user provided log handler.
 ~instance ()
 Destroys an instance of the driver.
instanceoperator= (instance &&other) noexcept
 Move assigns an instance of the driver.
instanceoperator= (instance const &)=delete
 This class is not copyable.

Static Public Member Functions

static instancecurrent ()

Constructor & Destructor Documentation

◆ instance() [1/4]

mongocxx::v_noabi::instance::instance ( )

Creates an instance of the driver.

◆ instance() [2/4]

mongocxx::v_noabi::instance::instance ( std::unique_ptr< v_noabi::logger > logger)

Creates an instance of the driver with a user provided log handler.

Parameters
loggerThe logger that the driver will direct log messages to.
Exceptions
mongocxx::v_noabi::logic_errorif an instance already exists.

◆ instance() [3/4]

mongocxx::v_noabi::instance::instance ( instance && other)
noexcept

Move constructs an instance of the driver.

Postconditions:
  • other is in an assign-or-destroy-only state.

◆ ~instance()

mongocxx::v_noabi::instance::~instance ( )

Destroys an instance of the driver.

◆ instance() [4/4]

mongocxx::v_noabi::instance::instance ( instance const & )
delete

This class is not copyable.

Member Function Documentation

◆ current()

instance & mongocxx::v_noabi::instance::current ( )
static
Warning
For internal use only!

◆ operator=() [1/2]

instance & mongocxx::v_noabi::instance::operator= ( instance && other)
noexcept

Move assigns an instance of the driver.

Postconditions:
  • other is in an assign-or-destroy-only state.

◆ operator=() [2/2]

instance & mongocxx::v_noabi::instance::operator= ( instance const & )
delete

This class is not copyable.


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