The Gaudi Framework
master (6507eef1)
Toggle main menu visibility
Loading...
Searching...
No Matches
SmartDataPtr.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 <
GaudiKernel/DataObject.h
>
14
#include <
GaudiKernel/SmartDataStorePtr.h
>
15
42
43
template
<
class
TYPE>
44
class
SmartDataPtr
:
public
SmartDataStorePtr
<TYPE, SmartDataObjectPtr::ObjectLoader> {
45
public
:
47
#if !defined( __ICC ) && !defined( __COVERITY__ )
48
// icc and Coverity do not like this line, they fail with
49
// SmartDataPtr.h(147): internal error: assertion failed: add_symbol_to_overload_list:
50
// symbol not in symbol header list (shared/edgcpfe/symbol_tbl.c, line 4804)
51
using
SmartDataStorePtr
<TYPE,
SmartDataObjectPtr::ObjectLoader
>::operator=;
52
#endif
61
SmartDataPtr
(
IDataProviderSvc
* pService, std::string fullPath )
62
:
SmartDataStorePtr
<TYPE,
SmartDataObjectPtr
::
ObjectLoader
>( pService, nullptr,
std
::move( fullPath ) ) {}
63
72
SmartDataPtr
(
IDataProviderSvc
* pService,
IRegistry
* pDirectory )
73
:
SmartDataStorePtr
<TYPE,
SmartDataObjectPtr
::
ObjectLoader
>( pService, pDirectory,
""
) {}
74
86
SmartDataPtr
(
IDataProviderSvc
* pService,
DataObject
* pObject, std::string
path
)
87
:
SmartDataStorePtr
<TYPE,
SmartDataObjectPtr
::
ObjectLoader
>( pService, nullptr,
std
::move(
path
) ) {
88
if
( pObject ) this->
m_pRegistry
= pObject->
registry
();
89
}
90
100
SmartDataPtr
(
SmartDataObjectPtr
& refObject,
IRegistry
* pDirectory )
101
:
SmartDataStorePtr
<TYPE,
SmartDataObjectPtr
::
ObjectLoader
>( refObject.
service
(), pDirectory,
""
) {}
102
112
SmartDataPtr
(
SmartDataObjectPtr
& refObject, std::string
path
)
113
:
SmartDataStorePtr
<TYPE,
SmartDataObjectPtr
::
ObjectLoader
>( refObject.
service
(), refObject.
directory
(),
114
std
::move(
path
) ) {}
115
119
SmartDataPtr
(
const
SmartDataObjectPtr
& copy ) :
SmartDataStorePtr
<TYPE,
SmartDataObjectPtr
::
ObjectLoader
>( copy ) {}
120
121
virtual
~SmartDataPtr
() =
default
;
122
124
template
<
class
OTHER>
125
SmartDataPtr
&
operator=
( OTHER* pObj ) {
126
this->
m_pObject
=
dynamic_cast<
TYPE*
>
( pObj );
127
return
*
this
;
128
}
129
131
template
<
class
OTHER>
132
SmartDataPtr
&
operator=
(
const
OTHER* pObj ) {
133
this->
m_pObject
=
dynamic_cast<
TYPE*
>
(
const_cast<
OTHER*
>
( pObj ) );
134
return
*
this
;
135
}
136
};
DataObject.h
SmartDataStorePtr.h
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition
DataObject.h:37
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition
DataObject.h:79
IDataProviderSvc
Data provider interface definition.
Definition
IDataProviderSvc.h:48
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition
IRegistry.h:29
SmartDataObjectPtr::ObjectLoader
Helper class to configure smart pointer functionality.
Definition
SmartDataObjectPtr.h:41
SmartDataObjectPtr
A small class used to access easily (and efficiently) data items residing in data stores.
Definition
SmartDataObjectPtr.h:37
SmartDataObjectPtr::path
const std::string & path() const
Path name.
Definition
SmartDataObjectPtr.h:76
SmartDataObjectPtr::service
IDataProviderSvc * service()
Retrieve data service.
Definition
SmartDataObjectPtr.h:85
SmartDataObjectPtr::directory
IRegistry * directory()
Access to data directory.
Definition
SmartDataObjectPtr.h:79
SmartDataObjectPtr::m_pRegistry
IRegistry * m_pRegistry
Pointer to the data registry containing the object.
Definition
SmartDataObjectPtr.h:167
SmartDataPtr::SmartDataPtr
SmartDataPtr(SmartDataObjectPtr &refObject, std::string path)
Standard constructor: Construct an SmartDataPtr instance which is able to connect to a DataObject ins...
Definition
SmartDataPtr.h:112
SmartDataPtr::SmartDataPtr
SmartDataPtr(IDataProviderSvc *pService, std::string fullPath)
Standard constructor: Construct an SmartDataPtr instance which is able to connect to a DataObject ins...
Definition
SmartDataPtr.h:61
SmartDataPtr::operator=
SmartDataPtr & operator=(OTHER *pObj)
Automatic conversion to data type.
Definition
SmartDataPtr.h:125
SmartDataPtr::operator=
SmartDataPtr & operator=(const OTHER *pObj)
Automatic conversion to data type.
Definition
SmartDataPtr.h:132
SmartDataPtr::~SmartDataPtr
virtual ~SmartDataPtr()=default
SmartDataPtr::SmartDataPtr
SmartDataPtr(IDataProviderSvc *pService, IRegistry *pDirectory)
Standard constructor: Construct an SmartDataPtr instance which is able to connect to a DataObject ins...
Definition
SmartDataPtr.h:72
SmartDataPtr::SmartDataPtr
SmartDataPtr(IDataProviderSvc *pService, DataObject *pObject, std::string path)
Standard constructor: Construct an SmartDataPtr instance which is able to connect to a DataObject ins...
Definition
SmartDataPtr.h:86
SmartDataPtr::SmartDataPtr
SmartDataPtr(const SmartDataObjectPtr ©)
Copy constructor: Construct an copy of a SmartDataPtr instance.
Definition
SmartDataPtr.h:119
SmartDataPtr::SmartDataPtr
SmartDataPtr(SmartDataObjectPtr &refObject, IRegistry *pDirectory)
Standard constructor: Construct an SmartDataPtr instance which is able to connect to a DataObject ins...
Definition
SmartDataPtr.h:100
SmartDataStorePtr< TYPE, SmartDataObjectPtr::ObjectLoader >::SmartDataStorePtr
SmartDataStorePtr(IDataProviderSvc *pService, IRegistry *pRegistry, std::string path)
Definition
SmartDataStorePtr.h:52
SmartDataStorePtr::m_pObject
TYPE * m_pObject
Pointer to data store object.
Definition
SmartDataStorePtr.h:115
std
STL namespace.
GaudiKernel
include
GaudiKernel
SmartDataPtr.h
Generated on
for The Gaudi Framework by
1.17.0