ATLAS Offline Software
Loading...
Searching...
No Matches
HiveDataObj.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 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
12class BaseClass { };
13
15
16public:
17
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
27private:
28 int m_val;
29};
30
31#include <iostream>
32 inline std::ostream& operator<<(std::ostream& ost, const HiveDataObj& rhs) {
33 ost << "HDO: " << rhs.val();
34 return ost;
35 }
36
37
38//using the macros below we can assign an identifier (and a version)
39//to the type HiveDataObj
40//This is required and checked at compile time when you try to record/retrieve
42CLASS_DEF( HiveDataObj , 37539154 , 1 )
43
44#endif
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
std::ostream & operator<<(std::ostream &ost, const HiveDataObj &rhs)
Definition HiveDataObj.h:32
std::true_type thread_safe
Definition HiveDataObj.h:25
virtual ~HiveDataObj()=default
int val() const
Definition HiveDataObj.h:23
void val(int i)
Definition HiveDataObj.h:22
HiveDataObj(int i)
Definition HiveDataObj.h:19