MarlinMT  0.1.0
marlinmt::book::WeakEntry Class Reference

Wrapper for weak pointer to Entry. More...

#include <Selection.h>

Public Member Functions

bool valid () const
 check if WeakEntry is usable. More...
 
const EntryKeykey () const
 get key from Entry. More...
 
template<typename T >
Handle< Entry< T > > handle () const
 create new Handle for Entry. More...
 

Private Member Functions

 WeakEntry (const std::shared_ptr< const details::Entry > &entry)
 
 WeakEntry (const std::shared_ptr< details::Entry > &entry)
 
 WeakEntry ()=default
 

Private Attributes

friend Selection
 
friend BookStore
 
std::weak_ptr< const details::Entry_entry {}
 wake reference to Entry More...
 

Detailed Description

Wrapper for weak pointer to Entry.

Mainly used for Selections.

Definition at line 29 of file Selection.h.

Constructor & Destructor Documentation

◆ WeakEntry() [1/3]

marlinmt::book::WeakEntry::WeakEntry ( const std::shared_ptr< const details::Entry > &  entry)
explicitprivate

Definition at line 8 of file Selection.cc.

◆ WeakEntry() [2/3]

marlinmt::book::WeakEntry::WeakEntry ( const std::shared_ptr< details::Entry > &  entry)
explicitprivate

Definition at line 11 of file Selection.cc.

◆ WeakEntry() [3/3]

marlinmt::book::WeakEntry::WeakEntry ( )
privatedefault

Member Function Documentation

◆ handle()

template<typename T >
Handle<Entry<T> > marlinmt::book::WeakEntry::handle ( ) const
inline

create new Handle for Entry.

Attention
don't use old Handle to the Entry after this.
Exceptions
BookStoreExceptionwhen WeakEntry is invalid.

Definition at line 58 of file Selection.h.

References _entry, MARLIN_BOOK_THROW, and valid().

◆ key()

const EntryKey & marlinmt::book::WeakEntry::key ( ) const

get key from Entry.

Definition at line 18 of file Selection.cc.

References _entry.

Referenced by marlinmt::book::Selection::find(), and marlinmt::BookStoreManager::getKey().

◆ valid()

bool marlinmt::book::WeakEntry::valid ( ) const

check if WeakEntry is usable.

Returns
false when Entry referenced by WeakEntry no longer exist

Definition at line 14 of file Selection.cc.

References _entry.

Referenced by marlinmt::book::Selection::find(), marlinmt::BookStoreManager::getKey(), and handle().

Member Data Documentation

◆ _entry

std::weak_ptr< const details::Entry > marlinmt::book::WeakEntry::_entry {}
private

wake reference to Entry

Definition at line 67 of file Selection.h.

Referenced by handle(), key(), and valid().

◆ BookStore

friend marlinmt::book::WeakEntry::BookStore
private

Definition at line 31 of file Selection.h.

◆ Selection

friend marlinmt::book::WeakEntry::Selection
private

Definition at line 30 of file Selection.h.


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