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-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
#ifndef DBHANDLEBASE_H
5
#define DBHANDLEBASE_H 1
6
7
// Framework include files
8
#include "
StorageSvc/DbType.h
"
9
17
template
<
class
T>
class
DbHandleBase
{
18
protected
:
20
typedef
T
_DataType
;
22
typedef
DbHandleBase<_DataType>
Base
;
24
T*
m_ptr
;
26
DbType
m_type
;
27
29
~DbHandleBase
() =
default
;
31
DbHandleBase
() :
m_ptr
(0),
m_type
(0) { }
32
33
// Copy/move handled by derived classes.
34
DbHandleBase
(
const
DbHandleBase
&) =
delete
;
35
DbHandleBase
(
DbHandleBase
&&) =
delete
;
36
DbHandleBase
&
operator=
(
const
DbHandleBase
&) =
delete
;
37
DbHandleBase
&
operator=
(
DbHandleBase
&&) =
delete
;
38
40
void
setType
(
const
DbType
& typ) {
m_type
=typ; }
42
void
setPtr
(T*
ptr
) {
m_ptr
=
ptr
; }
43
44
public
:
46
T*
operator->
() {
return
m_ptr
; }
47
const
T*
operator->
()
const
{
return
m_ptr
; }
49
bool
operator!
()
const
{
return
!
isValid
(); }
51
const
T*
ptr
()
const
{
return
m_ptr
; }
52
T*
ptr
() {
return
m_ptr
; }
54
bool
isValid
()
const
{
return
0 !=
m_ptr
; }
56
const
DbType
&
type
()
const
{
return
m_type
; }
57
};
58
59
#endif
DbType.h
DbHandleBase::isValid
bool isValid() const
Validity check (Objy like).
Definition
DbHandleBase.h:54
DbHandleBase< _DataType >::m_type
DbType m_type
Definition
DbHandleBase.h:26
DbHandleBase::DbHandleBase
DbHandleBase()
Standard constructor.
Definition
DbHandleBase.h:31
DbHandleBase::DbHandleBase
DbHandleBase(const DbHandleBase &)=delete
DbHandleBase::Base
DbHandleBase< _DataType > Base
Data type definition.
Definition
DbHandleBase.h:22
DbHandleBase::operator->
T * operator->()
Dereference operator.
Definition
DbHandleBase.h:46
DbHandleBase< _DataType >::m_ptr
_DataType * m_ptr
Definition
DbHandleBase.h:24
DbHandleBase::type
const DbType & type() const
Inquire storage type of the handle.
Definition
DbHandleBase.h:56
DbHandleBase< _DataType >::ptr
const _DataType * ptr() const
Definition
DbHandleBase.h:51
DbHandleBase::_DataType
T _DataType
Data type definition.
Definition
DbHandleBase.h:20
DbHandleBase::ptr
T * ptr()
Definition
DbHandleBase.h:52
DbHandleBase::operator=
DbHandleBase & operator=(const DbHandleBase &)=delete
DbHandleBase::operator!
bool operator!() const
Validity check through operator NOT.
Definition
DbHandleBase.h:49
DbHandleBase::operator->
const T * operator->() const
Definition
DbHandleBase.h:47
DbHandleBase::~DbHandleBase
~DbHandleBase()=default
Standard destructor.
DbHandleBase::DbHandleBase
DbHandleBase(DbHandleBase &&)=delete
DbHandleBase::setType
void setType(const DbType &typ)
Set handle type.
Definition
DbHandleBase.h:40
DbHandleBase::setPtr
void setPtr(T *ptr)
Set data pointer.
Definition
DbHandleBase.h:42
DbType
Keeps information about storage technology.
Definition
DbType.h:15
Generated on
for ATLAS Offline Software by
1.17.0