5#include "Stroika/Foundation/Execution/Activity.h"
8namespace Stroika::Foundation::Database::Document::Connection {
15 inline Ptr::Ptr (
const inherited& i) noexcept
19 inline Ptr::Ptr (nullptr_t) noexcept
23 inline bool Ptr::operator== (
const Ptr& rhs)
const noexcept
25 return this->get () == rhs.get ();
27 inline bool Ptr::operator== (nullptr_t)
const noexcept
29 return this->get () ==
nullptr;
31 inline auto Ptr::GetEngineProperties () const -> shared_ptr<const EngineProperties>
33 return this->get ()->GetEngineProperties ();
35 inline auto Ptr::GetOptions () const -> Options
37 return this->get ()->GetOptions ();
43 return this->get ()->GetSpaceConsumed ();
49 return this->get ()->GetCollections ();
55 return this->get ()->CreateCollection (name);
61 this->get ()->DropCollection (name);
67 return this->get ()->GetCollection (name);
71 using namespace Characters;
72 return Format (
"{}"_f,
static_cast<const void*
> (this->get ()));
76namespace Stroika::Foundation::Database::Document::Connection::Private_ {
80 template <
typename FUN>
81 auto WrapLoggingExecuteHelper_ (FUN&& f,
Connection::IRep* documentDBConnection,
const Connection::Options& options,
82 const optional<String>& collectionName,
bool write)
84 if (options.fOperationLoggingCallback ==
nullptr) {
88 auto callback = options.fOperationLoggingCallback;
89 Connection::Ptr connPtr = documentDBConnection->shared_from_this ();
90 callback (write ? Operation::eStartingWrite : Operation::eStartingRead, connPtr, collectionName, nullptr);
92 callback (write ? Operation::eCompletedWrite : Operation::eCompletedRead, connPtr, collectionName, nullptr);
98 callback (Operation::eNotifyError, connPtr, collectionName, current_exception ());
String is like std::u32string, except it is much easier to use, often much more space efficient,...
Set<T> is a container of T, where once an item is added, additionally adds () do nothing.
nonvirtual uintmax_t GetSpaceConsumed() const
nonvirtual Collection::Ptr GetCollection(const String &name) const
nonvirtual Set< String > GetCollections() const
return the names of all collections in the referenced database
nonvirtual String ToString() const
nonvirtual void DropCollection(const String &name) const
nonvirtual Collection::Ptr CreateCollection(const String &name) const
auto Finally(FUNCTION &&f) -> Private_::FinallySentry< FUNCTION >