ATLAS Offline Software
Tutorial/MyDataObj.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ATHEXSTOREGATEEXAMPLE_TUTORIAL_MYDATAOBJ_H
6 #define ATHEXSTOREGATEEXAMPLE_TUTORIAL_MYDATAOBJ_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 #include <iostream>
12 
13 namespace SGTutorial {
14 
15  class MyDataObj {
16 
17  public:
18 
19  MyDataObj(): m_val(0) {}
20  MyDataObj(int i): m_val(i) {}
21 
22  void val(int i) { m_val = i; }
23  int val() const { return m_val; }
24 
25  private:
26  int m_val;
27  };
28  inline std::ostream& operator<<(std::ostream& ost, const MyDataObj& rhs) {
29  ost << "Val: " << rhs.val();
30  return ost;
31  }
32 
33 } //end ns SGTutorial
34 //using the macros below we can assign an identifier (and a version)
35 //to the type MyDataObj
36 //This is required and checked at compile time when you try to record/retrieve
37 #include "AthenaKernel/CLASS_DEF.h"
39 
40 
41 #endif
42 
43 
SGTutorial::MyDataObj::val
int val() const
Definition: Tutorial/MyDataObj.h:23
python.trigbs_prescaleL1.ost
ost
Definition: trigbs_prescaleL1.py:104
SGTutorial::operator<<
OST & operator<<(OST &ost, LinkObj &rhs)
Definition: LinkObj.h:54
lumiFormat.i
int i
Definition: lumiFormat.py:85
SGTutorial::MyDataObj
Definition: Tutorial/MyDataObj.h:15
SGTutorial::MyDataObj::val
void val(int i)
Definition: Tutorial/MyDataObj.h:22
SGTutorial::MyDataObj::m_val
int m_val
Definition: Tutorial/MyDataObj.h:26
SGTutorial::MyDataObj::MyDataObj
MyDataObj(int i)
Definition: Tutorial/MyDataObj.h:20
SGTutorial
Definition: LinkObj.h:18
SGTutorial::MyDataObj::MyDataObj
MyDataObj()
Definition: Tutorial/MyDataObj.h:19
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:64
CLASS_DEF.h
macros to associate a CLID to a type