ATLAS Offline Software
Loading...
Searching...
No Matches
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
13
14namespace AthPyEx {
15
16class MyObj
17{
18public:
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
31private:
32 std::string m_name;
33 int m_a;
34};
35
36} // namespace AthPyEx
37
38CLASS_DEF(AthPyEx::MyObj, 28807578, 1)
39
40#endif
41
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
static Double_t a
virtual ~MyObj()
Definition MyObj.h:20
int getA()
Definition MyObj.h:29
MyObj(const std::string &name)
Definition MyObj.h:19
std::string m_name
Definition MyObj.h:32
const std::string & name()
Definition MyObj.h:22
void setA(T a)
Definition MyObj.h:23