fb-cpp 0.0.2
A modern C++ wrapper for the Firebird database API
Loading...
Searching...
No Matches
fbcpp::PooledAttachment Class Referencefinal

RAII lease for an Attachment borrowed from an AttachmentPool. More...

#include <AttachmentPool.h>

Public Member Functions

 PooledAttachment (PooledAttachment &&o) noexcept
 Move constructor.
 
PooledAttachmentoperator= (PooledAttachment &&o) noexcept
 Move assignment.
 
 PooledAttachment (const PooledAttachment &)=delete
 
PooledAttachmentoperator= (const PooledAttachment &)=delete
 
 ~PooledAttachment () noexcept
 Returns the Attachment to the pool, unless it was already released.
 
bool isValid () const noexcept
 Returns whether this object currently holds a leased Attachment.
 
Attachmentget () noexcept
 Returns the leased Attachment.
 
Attachmentoperator* () noexcept
 
Attachmentoperator-> () noexcept
 
void release ()
 Returns the leased Attachment to the pool immediately.
 

Friends

class AttachmentPool
 

Detailed Description

RAII lease for an Attachment borrowed from an AttachmentPool.

The leased Attachment is confined to the thread holding the lease; it is not thread-safe. Returns the Attachment to the pool when the lease is destroyed, unless it was already released.

Definition at line 230 of file AttachmentPool.h.

Constructor & Destructor Documentation

◆ PooledAttachment()

fbcpp::PooledAttachment::PooledAttachment ( PooledAttachment &&  o)
inlinenoexcept

Move constructor.

A moved PooledAttachment object becomes invalid.

Definition at line 246 of file AttachmentPool.h.

◆ ~PooledAttachment()

fbcpp::PooledAttachment::~PooledAttachment ( )
inlinenoexcept

Returns the Attachment to the pool, unless it was already released.

Definition at line 279 of file AttachmentPool.h.

Member Function Documentation

◆ get()

Attachment & fbcpp::PooledAttachment::get ( )
inlinenoexcept

Returns the leased Attachment.

Definition at line 303 of file AttachmentPool.h.

◆ isValid()

bool fbcpp::PooledAttachment::isValid ( ) const
inlinenoexcept

Returns whether this object currently holds a leased Attachment.

Definition at line 295 of file AttachmentPool.h.

◆ operator*()

Definition at line 309 of file AttachmentPool.h.

◆ operator->()

Definition at line 314 of file AttachmentPool.h.

◆ operator=()

Move assignment.

Releases the currently held Attachment (if any) back to the pool before taking ownership of o's.

Definition at line 258 of file AttachmentPool.h.

◆ release()

void fbcpp::PooledAttachment::release ( )
inline

Returns the leased Attachment to the pool immediately.

Does nothing if the lease was already released.

Definition at line 436 of file AttachmentPool.h.

Friends And Related Symbol Documentation

◆ AttachmentPool

Definition at line 232 of file AttachmentPool.h.


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