#include <Store.h>

Collaboration diagram for Store::EntryGuard:

Public Member Functions

 EntryGuard (Entry *entry, const char *context)
 
 ~EntryGuard ()
 
 EntryGuard (EntryGuard &&)=delete
 
Entryget ()
 
void unlockAndReset (const char *resetContext=nullptr)
 

Private Member Functions

void onException () noexcept
 

Private Attributes

Entryentry_
 the guarded Entry or nil More...
 
const char * context_
 default unlock() message More...
 

Detailed Description

a smart pointer similar to std::unique_ptr<> that automatically release()s and unlock()s the guarded Entry on stack-unwinding failures

Definition at line 329 of file Store.h.

Constructor & Destructor Documentation

Store::EntryGuard::EntryGuard ( Entry entry,
const char *  context 
)
inline
Parameters
entryeither nil or a locked Entry to manage
contextdefault unlock() message

Definition at line 333 of file Store.h.

References assert, entry_, and StoreEntry::locked().

Store::EntryGuard::~EntryGuard ( )
inline

Definition at line 338 of file Store.h.

References entry_, and onException().

Store::EntryGuard::EntryGuard ( EntryGuard &&  )
delete

Member Function Documentation

Entry* Store::EntryGuard::get ( void  )
inline

like std::unique_ptr::get()

Returns
nil or the guarded (locked) entry

Definition at line 349 of file Store.h.

References entry_.

void Store::EntryGuard::onException ( )
privatenoexcept

Definition at line 2154 of file store.cc.

References context_, entry_, StoreEntry::releaseRequest(), SWALLOW_EXCEPTIONS, and StoreEntry::unlock().

Referenced by ~EntryGuard().

void Store::EntryGuard::unlockAndReset ( const char *  resetContext = nullptr)
inline

like std::unique_ptr::reset() stops guarding the entry unlocks the entry (which may destroy it)

Definition at line 356 of file Store.h.

References context_, entry_, and StoreEntry::unlock().

Referenced by StoreEntry::setPublicKey().

Member Data Documentation

const char* Store::EntryGuard::context_
private

Definition at line 367 of file Store.h.

Referenced by onException(), and unlockAndReset().

Entry* Store::EntryGuard::entry_
private

Definition at line 366 of file Store.h.

Referenced by EntryGuard(), get(), onException(), unlockAndReset(), and ~EntryGuard().


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors