MarlinMT  0.1.0
marlinmt::book::details::Entry Class Reference

class to store and manage objects in BookStore. More...

#include <Entry.h>

Classes

struct  EntryHelper
 class which helps to access entry from the different EntryTypes More...
 

Public Member Functions

 Entry ()=default
 default constructor. Not valid! More...
 
template<class T >
Handle< T > handle (std::size_t idx=-1) const
 creates an handle for the entry. More...
 
const EntryKeykey () const
 access key data from entry. More...
 
bool valid () const
 check if entry is valid. More...
 

Private Member Functions

 Entry (std::shared_ptr< EntryBase > entry, EntryKey key)
 constructor More...
 
void clear ()
 reduce Entry to default constructed version. More...
 

Private Attributes

friend BookStore
 
EntryKey _key {std::type_index( typeid( void ) )}
 Key data for Entry. More...
 
std::shared_ptr< EntryBase_entry {nullptr}
 reference to entry data. More...
 

Detailed Description

class to store and manage objects in BookStore.

Definition at line 124 of file Entry.h.

Constructor & Destructor Documentation

◆ Entry() [1/2]

marlinmt::book::details::Entry::Entry ( std::shared_ptr< EntryBase entry,
EntryKey  key 
)
inlineprivate

constructor

Definition at line 128 of file Entry.h.

◆ Entry() [2/2]

marlinmt::book::details::Entry::Entry ( )
default

default constructor. Not valid!

Member Function Documentation

◆ clear()

void marlinmt::book::details::Entry::clear ( )
inlineprivate

reduce Entry to default constructed version.

Definition at line 132 of file Entry.h.

◆ handle()

template<class T >
Handle< T > marlinmt::book::details::Entry::handle ( std::size_t  idx = -1) const
inline

creates an handle for the entry.

Parameters
idxof instance, only used for multi copy entries
Exceptions
BookStoreExceptionwhen the Entry has Invalid Flags, or type mismatch with demanded Handle.
Returns
empty optional if the type or the configuration not matches.

Definition at line 250 of file Entry.h.

References MARLIN_BOOK_THROW.

◆ key()

const EntryKey& marlinmt::book::details::Entry::key ( ) const
inline

access key data from entry.

Definition at line 260 of file Entry.h.

◆ valid()

bool marlinmt::book::details::Entry::valid ( ) const
inline

check if entry is valid.

check if there is a reference stored or not.

Returns
true if entry is valid.

Definition at line 267 of file Entry.h.

Member Data Documentation

◆ _entry

std::shared_ptr< EntryBase > marlinmt::book::details::Entry::_entry {nullptr}
private

reference to entry data.

Definition at line 273 of file Entry.h.

◆ _key

EntryKey marlinmt::book::details::Entry::_key {std::type_index( typeid( void ) )}
private

Key data for Entry.

Definition at line 271 of file Entry.h.

◆ BookStore

friend marlinmt::book::details::Entry::BookStore
private

Definition at line 125 of file Entry.h.


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