ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaExamples
AthExHive
AthExHive
HiveDataObj.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef ATHEXHIVE_HIVEDATAOBJ_H
6
#define ATHEXHIVE_HIVEDATAOBJ_H
7
8
//sample data class for the Read/Write example
9
//it just wraps an int. Notice that is does not inherit from Gaudi DataObject
10
11
//a dummy base class to test the symlinks
12
class
BaseClass
{ };
13
14
class
HiveDataObj
{
15
16
public
:
17
18
HiveDataObj
():
m_val
(0) {};
19
HiveDataObj
(
int
i):
m_val
(i) {};
20
virtual
~HiveDataObj
() =
default
;
21
22
void
val
(
int
i) {
m_val
= i; }
23
int
val
()
const
{
return
m_val
; }
24
25
typedef
std::true_type
thread_safe
;
26
27
private
:
28
int
m_val
;
29
};
30
31
32
#include <format>
33
namespace
std
{
34
35
template
<>
36
struct
formatter<
HiveDataObj
>
37
:
public
formatter<string_view>
38
{
39
template
<
class
FmtContext>
40
FmtContext::iterator
format
(
const
HiveDataObj
& io, FmtContext& ctx)
const
41
{
42
return
std::format_to (ctx.out(),
"{}"
, io.val());
43
}
44
};
45
46
}
// namespace std
47
48
49
//using the macros below we can assign an identifier (and a version)
50
//to the type HiveDataObj
51
//This is required and checked at compile time when you try to record/retrieve
52
#include "
AthenaKernel/CLASS_DEF.h
"
53
CLASS_DEF
(
HiveDataObj
, 37539154 , 1 )
54
55
#endif
CLASS_DEF.h
macros to associate a CLID to a type
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition
Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:67
BaseClass
Definition
HiveDataObj.h:12
HiveDataObj
Definition
HiveDataObj.h:14
HiveDataObj::HiveDataObj
HiveDataObj()
Definition
HiveDataObj.h:18
HiveDataObj::thread_safe
std::true_type thread_safe
Definition
HiveDataObj.h:25
HiveDataObj::~HiveDataObj
virtual ~HiveDataObj()=default
HiveDataObj::val
int val() const
Definition
HiveDataObj.h:23
HiveDataObj::m_val
int m_val
Definition
HiveDataObj.h:28
HiveDataObj::val
void val(int i)
Definition
HiveDataObj.h:22
HiveDataObj::HiveDataObj
HiveDataObj(int i)
Definition
HiveDataObj.h:19
std
STL namespace.
std::formatter< HiveDataObj >::format
FmtContext::iterator format(const HiveDataObj &io, FmtContext &ctx) const
Definition
HiveDataObj.h:40
Generated on
for ATLAS Offline Software by
1.17.0