The Gaudi Framework
master (ff7c8557)
Toggle main menu visibility
Loading...
Searching...
No Matches
DataStoreItem.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
#pragma once
12
13
#include <string>
14
25
class
DataStoreItem
{
26
protected
:
28
std::string
m_path
;
30
int
m_depth
;
31
32
public
:
34
DataStoreItem
( std::string
path
,
int
depth
= 1 ) :
m_path
(
std
::move(
path
) ),
m_depth
(
depth
) {
analyse
(); }
36
DataStoreItem
(
const
DataStoreItem
& item ) :
m_path
( item.
m_path
),
m_depth
( item.
m_depth
) {
analyse
(); }
38
virtual
~DataStoreItem
() =
default
;
39
41
bool
operator==
(
const
DataStoreItem
& cmp )
const
{
return
m_path
== cmp.
path
() &&
m_depth
== cmp.
depth
(); }
43
bool
operator!=
(
const
DataStoreItem
& cmp )
const
{
return
!(
m_path
== cmp.
path
() &&
m_depth
== cmp.
depth
() ); }
45
DataStoreItem
&
operator=
(
const
DataStoreItem
& cmp ) {
46
m_path
= cmp.
path
();
47
m_depth
= cmp.
depth
();
48
analyse
();
49
return
*
this
;
50
}
51
52
void
analyse
() {
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
}
63
64
const
std::string&
path
()
const
{
return
m_path
; }
66
int
depth
()
const
{
return
m_depth
; }
67
};
DataStoreItem::operator!=
bool operator!=(const DataStoreItem &cmp) const
Inequality operator.
Definition
DataStoreItem.h:43
DataStoreItem::analyse
void analyse()
Interprete the load path for special options.
Definition
DataStoreItem.h:52
DataStoreItem::DataStoreItem
DataStoreItem(const DataStoreItem &item)
Copy constructor.
Definition
DataStoreItem.h:36
DataStoreItem::m_depth
int m_depth
Depth to be auto-loaded from the requested path onwards.
Definition
DataStoreItem.h:30
DataStoreItem::depth
int depth() const
Accessor: Retrieve load depth.
Definition
DataStoreItem.h:66
DataStoreItem::path
const std::string & path() const
Accessor: Retrieve load path.
Definition
DataStoreItem.h:64
DataStoreItem::operator=
DataStoreItem & operator=(const DataStoreItem &cmp)
Equivalence operator.
Definition
DataStoreItem.h:45
DataStoreItem::DataStoreItem
DataStoreItem(std::string path, int depth=1)
Standard Constructor.
Definition
DataStoreItem.h:34
DataStoreItem::operator==
bool operator==(const DataStoreItem &cmp) const
Equality operator.
Definition
DataStoreItem.h:41
DataStoreItem::~DataStoreItem
virtual ~DataStoreItem()=default
Standard Destructor.
DataStoreItem::m_path
std::string m_path
Path of item to be loaded.
Definition
DataStoreItem.h:28
std
STL namespace.
GaudiKernel
include
GaudiKernel
DataStoreItem.h
Generated on
for The Gaudi Framework by
1.17.0