The Gaudi Framework  master (adcf1ca6)
Loading...
Searching...
No Matches
DataObjectHandleBase.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 <mutex>
14
19#include <GaudiKernel/SmartIF.h>
20
21//---------------------------------------------------------------------------
22
31
32//---------------------------------------------------------------------------
33
35
36public:
39
40 ~DataObjectHandleBase() override;
44
45 friend std::ostream& operator<<( std::ostream& str, const DataObjectHandleBase& d );
46
48 bool isOptional() const { return m_optional; }
49 void setOptional( bool optional = true ) { m_optional = optional; }
50
51 bool isValid() const;
52
53protected:
54 bool init() override;
55
56 DataObject* fetch() const;
57
58protected:
61
62 bool m_init = false;
63 bool m_optional = false;
64};
void setOptional(bool optional=true)
friend std::ostream & operator<<(std::ostream &str, const DataObjectHandleBase &d)
SmartIF< IDataProviderSvc > m_EDS
SmartIF< IMessageSvc > m_MS
DataObjectHandleBase(const DataObjectHandleBase &)=delete
bool isOptional() const
Check if the data object declared is optional for the algorithm.
DataObjectHandleBase(DataObjID k, Gaudi::DataHandle::Mode a, IDataHandleHolder *owner)
DataObject * fetch() const
DataObjectHandleBase & operator=(const DataObjectHandleBase &)
A DataObject is the base class of any identifiable object on any data store.
Definition DataObject.h:37
virtual IDataHandleHolder * owner() const
Definition DataHandle.h:52
Small smart pointer class with automatic reference counting for IInterface.
Definition SmartIF.h:28