ATLAS Offline Software
ExampleClass.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ATHENAPOOLEXAMPLEDATA_EXAMPLECLASS_H
6 #define ATHENAPOOLEXAMPLEDATA_EXAMPLECLASS_H
7 
14 #include <string>
15 
19 class ExampleClass {
20 
21 public: // Constructor and Destructor
23  ExampleClass() : m_run(0), m_event(0), m_text("") {}
25  virtual ~ExampleClass() {}
26 
27 public: // Non-static members
29  int getRun() const { return(m_run); }
30 
32  int getEvent() const { return(m_event); }
33 
35  const std::string& getText() const { return(m_text); }
36 
39  void setRun(int run) { m_run = run; }
40 
43  void setEvent(int event) { m_event = event; }
44 
47  void setText(const std::string& text) { m_text = text; }
48 
49 private:
50  int m_run;
51  int m_event;
52  std::string m_text;
53 };
54 #include "AthenaKernel/CLASS_DEF.h"
55 CLASS_DEF(ExampleClass, 67289510, 1)
56 #endif
ExampleClass::setRun
void setRun(int run)
Set the run number.
Definition: ExampleClass.h:39
ExampleClass::setText
void setText(const std::string &text)
Set the text string.
Definition: ExampleClass.h:47
run
int run(int argc, char *argv[])
Definition: ttree2hdf5.cxx:28
ExampleClass::m_text
std::string m_text
Definition: ExampleClass.h:52
ExampleClass::~ExampleClass
virtual ~ExampleClass()
Destructor.
Definition: ExampleClass.h:25
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
ExampleClass::getRun
int getRun() const
Definition: ExampleClass.h:29
run
Definition: run.py:1
ExampleClass::setEvent
void setEvent(int event)
Set the event number.
Definition: ExampleClass.h:43
ExampleClass::ExampleClass
ExampleClass()
Default Constructor.
Definition: ExampleClass.h:23
ExampleClass::getEvent
int getEvent() const
Definition: ExampleClass.h:32
ExampleClass::getText
const std::string & getText() const
Definition: ExampleClass.h:35
ExampleClass::m_run
int m_run
Definition: ExampleClass.h:50
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
makeTransCanvas.text
text
Definition: makeTransCanvas.py:11
ExampleClass
This class provides an example data object for AthenaPool.
Definition: ExampleClass.h:19
ExampleClass::m_event
int m_event
Definition: ExampleClass.h:51
CLASS_DEF.h
macros to associate a CLID to a type