The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
DataStoreItem Class Reference

Description of the DataStoreItem class. More...

#include <GaudiKernel/DataStoreItem.h>

Collaboration diagram for DataStoreItem:

Public Member Functions

 DataStoreItem (std::string path, int depth=1)
 Standard Constructor.
 
 DataStoreItem (const DataStoreItem &item)
 Copy constructor.
 
virtual ~DataStoreItem ()=default
 Standard Destructor.
 
bool operator== (const DataStoreItem &cmp) const
 Equality operator.
 
bool operator!= (const DataStoreItem &cmp) const
 Inequality operator.
 
DataStoreItemoperator= (const DataStoreItem &cmp)
 Equivalence operator.
 
void analyse ()
 Interprete the load path for special options.
 
const std::string & path () const
 Accessor: Retrieve load path.
 
int depth () const
 Accessor: Retrieve load depth.
 

Protected Attributes

std::string m_path
 Path of item to be loaded.
 
int m_depth
 Depth to be auto-loaded from the requested path onwards.
 

Detailed Description

Description of the DataStoreItem class.

DataStoreItems describe in an abstract way an item in the data store. Items can be supplied to the services in order to e.g. trigger preloading or writing.

Author
M.Frank
Version
1.0

Definition at line 25 of file DataStoreItem.h.

Constructor & Destructor Documentation

◆ DataStoreItem() [1/2]

DataStoreItem::DataStoreItem ( std::string path,
int depth = 1 )
inline

Standard Constructor.

Definition at line 34 of file DataStoreItem.h.

34: m_path( std::move( path ) ), m_depth( depth ) { analyse(); }
void analyse()
Interprete the load path for special options.
int m_depth
Depth to be auto-loaded from the requested path onwards.
int depth() const
Accessor: Retrieve load depth.
const std::string & path() const
Accessor: Retrieve load path.
std::string m_path
Path of item to be loaded.

◆ DataStoreItem() [2/2]

DataStoreItem::DataStoreItem ( const DataStoreItem & item)
inline

Copy constructor.

Definition at line 36 of file DataStoreItem.h.

36: m_path( item.m_path ), m_depth( item.m_depth ) { analyse(); }

◆ ~DataStoreItem()

virtual DataStoreItem::~DataStoreItem ( )
virtualdefault

Standard Destructor.

Member Function Documentation

◆ analyse()

void DataStoreItem::analyse ( )
inline

Interprete the load path for special options.

Definition at line 52 of file DataStoreItem.h.

52 {
53 if ( m_path.empty() ) return;
54 const size_t len = m_path.length() - 1;
55 if ( m_path[len] == '*' ) {
56 m_depth = 99999999;
57 ( len > 0 && m_path[len - 1] == '/' ) ? m_path.erase( len - 1, 2 ) : m_path.erase( len, 1 );
58 } else if ( m_path[len] == '+' ) {
59 ( len > 0 && m_path[len - 1] == '/' ) ? m_path.erase( len - 1, 2 ) : m_path.erase( len, 1 );
60 m_depth = 2;
61 }
62 }

◆ depth()

int DataStoreItem::depth ( ) const
inline

Accessor: Retrieve load depth.

Definition at line 66 of file DataStoreItem.h.

66{ return m_depth; }

◆ operator!=()

bool DataStoreItem::operator!= ( const DataStoreItem & cmp) const
inline

Inequality operator.

Definition at line 43 of file DataStoreItem.h.

43{ return !( m_path == cmp.path() && m_depth == cmp.depth() ); }

◆ operator=()

DataStoreItem & DataStoreItem::operator= ( const DataStoreItem & cmp)
inline

Equivalence operator.

Definition at line 45 of file DataStoreItem.h.

45 {
46 m_path = cmp.path();
47 m_depth = cmp.depth();
48 analyse();
49 return *this;
50 }

◆ operator==()

bool DataStoreItem::operator== ( const DataStoreItem & cmp) const
inline

Equality operator.

Definition at line 41 of file DataStoreItem.h.

41{ return m_path == cmp.path() && m_depth == cmp.depth(); }

◆ path()

const std::string & DataStoreItem::path ( ) const
inline

Accessor: Retrieve load path.

Definition at line 64 of file DataStoreItem.h.

64{ return m_path; }

Member Data Documentation

◆ m_depth

int DataStoreItem::m_depth
protected

Depth to be auto-loaded from the requested path onwards.

Definition at line 30 of file DataStoreItem.h.

◆ m_path

std::string DataStoreItem::m_path
protected

Path of item to be loaded.

Definition at line 28 of file DataStoreItem.h.


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