The Gaudi Framework
master (bdbe7744)
Toggle main menu visibility
Loading...
Searching...
No Matches
SmartDataLocator.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/SmartDataPtr.h
>
14
41
42
template
<
class
TYPE>
43
class
SmartDataLocator
:
public
SmartDataStorePtr
<TYPE, SmartDataObjectPtr::ObjectLoader> {
44
public
:
53
SmartDataLocator
(
IDataProviderSvc
* pService,
const
std::string& fullPath )
54
:
SmartDataStorePtr
<TYPE,
SmartDataObjectPtr
::
ObjectLoader
>( pService, 0, fullPath ) {}
55
64
SmartDataLocator
(
IDataProviderSvc
* pService,
IRegistry
* pDirectory )
65
:
SmartDataStorePtr
<TYPE,
SmartDataObjectPtr
::
ObjectLoader
>( pService, pDirectory,
""
) {}
66
78
SmartDataLocator
(
IDataProviderSvc
* pService,
DataObject
* pObject,
const
std::string&
path
)
79
:
SmartDataStorePtr
<TYPE,
SmartDataObjectPtr
::
ObjectLoader
>( pService, 0,
path
) {
80
if
( 0 != pObject ) { this->m_pDirectory = pObject->
registry
(); }
81
}
82
92
SmartDataLocator
(
SmartDataObjectPtr
& refObject,
IRegistry
* pDirectory )
93
:
SmartDataStorePtr
<TYPE,
SmartDataObjectPtr
::
ObjectLoader
>( refObject.
service
(), pDirectory,
""
) {}
94
104
SmartDataLocator
(
SmartDataObjectPtr
& refObject,
const
std::string&
path
)
105
:
SmartDataStorePtr
<TYPE,
SmartDataObjectPtr
::
ObjectLoader
>( refObject.
service
(), refObject.
directory
(),
path
) {}
106
109
virtual
~SmartDataLocator
() {}
110
112
template
<
class
OTHER>
113
SmartDataPtr<OTHER>
&
operator=
( OTHER* pObj ) {
114
this->
m_pObject
=
dynamic_cast<
TYPE*
>
( pObj );
115
return
*
this
;
116
}
117
119
template
<
class
OTHER>
120
SmartDataPtr<OTHER>
&
operator=
(
const
OTHER* pObj ) {
121
this->
m_pObject
=
dynamic_cast<
TYPE*
>
(
const_cast<
OTHER*
>
( pObj ) );
122
return
*
this
;
123
}
124
};
SmartDataPtr.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
SmartDataLocator::SmartDataLocator
SmartDataLocator(IDataProviderSvc *pService, IRegistry *pDirectory)
Standard constructor: Construct an SmartDataLocator instance which is able to connect to a DataObject...
Definition
SmartDataLocator.h:64
SmartDataLocator::SmartDataLocator
SmartDataLocator(IDataProviderSvc *pService, const std::string &fullPath)
Standard constructor: Construct an SmartDataLocator instance which is able to connect to a DataObject...
Definition
SmartDataLocator.h:53
SmartDataLocator::SmartDataLocator
SmartDataLocator(IDataProviderSvc *pService, DataObject *pObject, const std::string &path)
Standard constructor: Construct an SmartDataLocator instance which is able to connect to a DataObject...
Definition
SmartDataLocator.h:78
SmartDataLocator::SmartDataLocator
SmartDataLocator(SmartDataObjectPtr &refObject, const std::string &path)
Standard constructor: Construct an SmartDataLocator instance which is able to connect to a DataObject...
Definition
SmartDataLocator.h:104
SmartDataLocator::SmartDataLocator
SmartDataLocator(SmartDataObjectPtr &refObject, IRegistry *pDirectory)
Standard constructor: Construct an SmartDataLocator instance which is able to connect to a DataObject...
Definition
SmartDataLocator.h:92
SmartDataLocator::~SmartDataLocator
virtual ~SmartDataLocator()
Standard destructor.
Definition
SmartDataLocator.h:109
SmartDataLocator::operator=
SmartDataPtr< OTHER > & operator=(OTHER *pObj)
Automatic conversion to data type.
Definition
SmartDataLocator.h:113
SmartDataLocator::operator=
SmartDataPtr< OTHER > & operator=(const OTHER *pObj)
Automatic conversion to data type.
Definition
SmartDataLocator.h:120
SmartDataObjectPtr::ObjectLoader
Helper class to configure smart pointer functionality.
Definition
SmartDataObjectPtr.h:41
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::SmartDataObjectPtr
SmartDataObjectPtr(AccessFunction access, IDataProviderSvc *pService, IRegistry *pDir, std::string path)
Standard constructor: Construct an SmartDataObjectPtr instance.
Definition
SmartDataObjectPtr.h:59
SmartDataObjectPtr::directory
IRegistry * directory()
Access to data directory.
Definition
SmartDataObjectPtr.h:79
SmartDataPtr
A small class used to access easily (and efficiently) data items residing in data stores.
Definition
SmartDataPtr.h:44
SmartDataStorePtr< TYPE, SmartDataObjectPtr::ObjectLoader >::SmartDataStorePtr
SmartDataStorePtr(IDataProviderSvc *pService, IRegistry *pRegistry, std::string path)
Definition
SmartDataStorePtr.h:52
SmartDataStorePtr< TYPE, SmartDataObjectPtr::ObjectLoader >::m_pObject
TYPE * m_pObject
Definition
SmartDataStorePtr.h:115
GaudiKernel
include
GaudiKernel
SmartDataLocator.h
Generated on
for The Gaudi Framework by
1.17.0