ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Database
APR
StorageSvc
StorageSvc
DbHandleBase.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
//====================================================================
6
// Pool Handle Base class definitions
7
//--------------------------------------------------------------------
8
//
9
// Package : StorageSvc (The POOL project)
10
// @author M.Frank
11
//====================================================================
12
#ifndef POOL_DBHANDLEBASE_H
13
#define POOL_DBHANDLEBASE_H 1
14
15
// Framework include files
16
#include "
StorageSvc/DbType.h
"
17
18
/*
19
* POOL namespace declaration
20
*/
21
namespace
pool
{
22
31
template
<
class
T>
class
DbHandleBase
{
32
protected
:
34
typedef
T
_DataType
;
36
typedef
DbHandleBase<_DataType>
Base
;
38
T*
m_ptr
;
40
DbType
m_type
;
41
43
~DbHandleBase
() =
default
;
45
DbHandleBase
() :
m_ptr
(0),
m_type
(0) { }
46
47
// Copy/move handled by derived classes.
48
DbHandleBase
(
const
DbHandleBase
&) =
delete
;
49
DbHandleBase
(
DbHandleBase
&&) =
delete
;
50
DbHandleBase
&
operator=
(
const
DbHandleBase
&) =
delete
;
51
DbHandleBase
&
operator=
(
DbHandleBase
&&) =
delete
;
52
54
void
setType
(
const
DbType
& typ) {
m_type
=typ; }
56
void
setPtr
(T*
ptr
) {
m_ptr
=
ptr
; }
57
58
public
:
60
T*
operator->
() {
return
m_ptr
; }
61
const
T*
operator->
()
const
{
return
m_ptr
; }
63
bool
operator!
()
const
{
return
!
isValid
(); }
65
const
T*
ptr
()
const
{
return
m_ptr
; }
66
T*
ptr
() {
return
m_ptr
; }
68
bool
isValid
()
const
{
return
0 !=
m_ptr
; }
70
const
DbType
&
type
()
const
{
return
m_type
; }
71
};
72
}
// End namespace pool
73
#endif
// POOL_DBHANDLEBASE_H
DbType.h
pool::DbHandleBase< _DataType >::ptr
const _DataType * ptr() const
Definition
DbHandleBase.h:65
pool::DbHandleBase::_DataType
T _DataType
Data type definition.
Definition
DbHandleBase.h:34
pool::DbHandleBase< _DataType >::m_ptr
_DataType * m_ptr
Definition
DbHandleBase.h:38
pool::DbHandleBase::~DbHandleBase
~DbHandleBase()=default
Standard destructor.
pool::DbHandleBase::isValid
bool isValid() const
Validity check (Objy like).
Definition
DbHandleBase.h:68
pool::DbHandleBase::operator->
T * operator->()
Dereference operator.
Definition
DbHandleBase.h:60
pool::DbHandleBase::setPtr
void setPtr(T *ptr)
Set data pointer.
Definition
DbHandleBase.h:56
pool::DbHandleBase::ptr
T * ptr()
Definition
DbHandleBase.h:66
pool::DbHandleBase::setType
void setType(const DbType &typ)
Set handle type.
Definition
DbHandleBase.h:54
pool::DbHandleBase< _DataType >::m_type
DbType m_type
Definition
DbHandleBase.h:40
pool::DbHandleBase::operator=
DbHandleBase & operator=(const DbHandleBase &)=delete
pool::DbHandleBase::DbHandleBase
DbHandleBase(const DbHandleBase &)=delete
pool::DbHandleBase::DbHandleBase
DbHandleBase()
Standard constructor.
Definition
DbHandleBase.h:45
pool::DbHandleBase::operator->
const T * operator->() const
Definition
DbHandleBase.h:61
pool::DbHandleBase::operator!
bool operator!() const
Validity check through operator NOT.
Definition
DbHandleBase.h:63
pool::DbHandleBase::type
const DbType & type() const
Inquire storage type of the handle.
Definition
DbHandleBase.h:70
pool::DbHandleBase::DbHandleBase
DbHandleBase(DbHandleBase &&)=delete
pool::DbHandleBase::Base
DbHandleBase< _DataType > Base
Data type definition.
Definition
DbHandleBase.h:36
pool::DbType
Definition
DbType.h:30
pool
Framework include files.
Definition
libname.h:15
Generated on
for ATLAS Offline Software by
1.17.0