ATLAS Offline Software
Loading...
Searching...
No Matches
MyTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef PYANALYSISEXAMPLES_MYTOOL_H
6#define PYANALYSISEXAMPLES_MYTOOL_H
7
8// Work around a compilation warning.
9#ifdef _POSIX_C_SOURCE
10# undef _POSIX_C_SOURCE
11#endif
12#ifdef _XOPEN_SOURCE
13# undef _XOPEN_SOURCE
14#endif
15#include "Python.h"
17
18namespace AthPyEx {
19
20class MyObj;
21
22class MyTool : public AthAlgTool
23{
24public:
25
28 MyTool ( const std::string& type, const std::string& name,
29 const IInterface* parent )
30 : AthAlgTool(type,name,parent),
31 m_A(0),
32 m_self(0)
33 {}
34
37 virtual ~MyTool () {}
38
41 static const InterfaceID& interfaceID( ) ;
42
45 void setPython(PyObject *self)
46 {
47 m_self=self;
48 }
49
50 StatusCode execute(MyObj *obj);
51
54 int getA () const ;
55 void setA (int a);
56
57private:
58 int m_A;
59
61
63};
64
65} //> end namespace AthPyEx
66
67#endif
68
69
_object PyObject
static Double_t a
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
int getA() const
accessor
Definition MyTool.cxx:48
StatusCode execute(MyObj *obj)
Definition MyTool.cxx:20
MyTool(const std::string &type, const std::string &name, const IInterface *parent)
constructor
Definition MyTool.h:28
PyObject * m_self
Definition MyTool.h:60
MyTool & operator=(const MyTool &)
void setPython(PyObject *self)
set Python binding
Definition MyTool.h:45
static const InterfaceID & interfaceID()
InterfaceID.
Definition MyTool.cxx:17
virtual ~MyTool()
destructor
Definition MyTool.h:37
void setA(int a)
Definition MyTool.cxx:53