ATLAS Offline Software
MyObj.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 PYANALYSISEXAMPLES_MYOBJ_H
6 #define PYANALYSISEXAMPLES_MYOBJ_H
7 
8 #include <string>
9 #include <iostream>
10 #include <typeinfo>
11 
12 #include "AthenaKernel/CLASS_DEF.h"
13 
14 namespace AthPyEx {
15 
16 class MyObj
17 {
18 public:
19  MyObj (const std::string &name) : m_name(name), m_a(0) { }
20  virtual ~MyObj () {}
21 
22  const std::string& name () { return m_name; }
23  template <class T> void setA(T a)
24  {
25  std::cout << " C++ setA " << typeid(a).name() << " " << a << std::endl;
26  m_a = (int)a;
27  }
28 
29  int getA() { return m_a;}
30 
31 private:
32  std::string m_name;
33  int m_a;
34 };
35 
36 } // namespace AthPyEx
37 
38 CLASS_DEF(AthPyEx::MyObj, 28807578, 1)
39 
40 #endif
41 
AthPyEx::MyObj::name
const std::string & name()
Definition: MyObj.h:22
AthPyEx
Definition: MyCutClass.h:13
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
AthPyEx::MyObj::setA
void setA(T a)
Definition: MyObj.h:23
AthPyEx::MyObj
Definition: MyObj.h:17
AthPyEx::MyObj::m_a
int m_a
Definition: MyObj.h:33
AthPyEx::MyObj::getA
int getA()
Definition: MyObj.h:29
AthPyEx::MyObj::MyObj
MyObj(const std::string &name)
Definition: MyObj.h:19
a
TList * a
Definition: liststreamerinfos.cxx:10
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
AthPyEx::MyObj::~MyObj
virtual ~MyObj()
Definition: MyObj.h:20
AthPyEx::MyObj::m_name
std::string m_name
Definition: MyObj.h:32
CLASS_DEF.h
macros to associate a CLID to a type