Poco::MongoDB

class PooledReplicaSetConnection

Library: MongoDB
Package: MongoDB
Header: Poco/MongoDB/ReplicaSetPoolableConnectionFactory.h

Description

Helper class for borrowing and returning a ReplicaSetConnection automatically from a pool.

This class uses RAII to automatically return the connection to the pool when it goes out of scope.

Usage:

{
    PooledReplicaSetConnection conn(pool);
    conn->sendRequest(request, response);
}  // Connection automatically returned to pool

Note: The connection pool must outlive the PooledReplicaSetConnection instance.

Member Summary

Member Functions: operator *, operator =, operator->

Constructors

PooledReplicaSetConnection inline

PooledReplicaSetConnection(
    Poco::ObjectPool < ReplicaSetConnection, ReplicaSetConnection::Ptr > & pool
);

PooledReplicaSetConnection

PooledReplicaSetConnection(
    const PooledReplicaSetConnection & param432
) = delete;

PooledReplicaSetConnection

PooledReplicaSetConnection(
    PooledReplicaSetConnection && other
) noexcept = default;

Destructor

~PooledReplicaSetConnection virtual inline

virtual ~PooledReplicaSetConnection();

Member Functions

operator * inline

ReplicaSetConnection & operator * ();

operator =

PooledReplicaSetConnection & operator = (
    const PooledReplicaSetConnection & param433
) = delete;

operator =

PooledReplicaSetConnection & operator = (
    PooledReplicaSetConnection && other
) noexcept = default;

operator-> inline

ReplicaSetConnection::Ptr operator-> ();