Loading [MathJax]/extensions/tex2jax.js
ROOT
6.06/09
Reference Guide
ROOT Home Page
Main Page
Related Pages
User's Classes
Namespaces
All Classes
Files
Release Notes
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
bindings
pyroot
src
TMemoryRegulator.h
Go to the documentation of this file.
1
// @(#)root/pyroot:$Id$
2
// Author: Wim Lavrijsen, Apr 2004
3
4
#ifndef PYROOT_TMEMORYREGULATOR_H
5
#define PYROOT_TMEMORYREGULATOR_H
6
7
// ROOT
8
#include "
TObject.h
"
9
10
// Standard
11
#include <map>
12
13
14
namespace
PyROOT
{
15
16
/** Communicate object destruction across ROOT/CINT/PyROOT/
17
@author WLAV
18
@date 11/23/2004
19
@version 2.2
20
*/
21
22
class
ObjectProxy;
23
24
class
TMemoryRegulator
:
public
TObject
{
25
public
:
26
TMemoryRegulator
();
27
~TMemoryRegulator
();
28
29
// callback for ROOT/CINT
30
virtual
void
RecursiveRemove
(
TObject
*
object
);
31
32
// add a python object to the table of managed objects
33
static
Bool_t
RegisterObject
(
ObjectProxy
* pyobj,
TObject
*
object
);
34
35
// remove a python object from the table of managed objects, w/o notification
36
static
Bool_t
UnregisterObject
(
TObject
*
object
);
37
38
// new reference to python object corresponding to object, or 0 on failure
39
static
PyObject
*
RetrieveObject
(
TObject
*
object
,
Cppyy::TCppType_t
klass );
40
41
// callback when weak refs to managed objects are destroyed
42
static
PyObject
*
ObjectEraseCallback
(
PyObject
*,
PyObject
* pyref );
43
44
private
:
45
typedef
std::map< TObject*, PyObject* >
ObjectMap_t
;
46
typedef
std::map< PyObject*, ObjectMap_t::iterator >
WeakRefMap_t
;
47
48
static
ObjectMap_t*
fgObjectTable
;
49
static
WeakRefMap_t*
fgWeakRefTable
;
50
};
51
52
}
// namespace PyROOT
53
54
#endif // !PYROOT_TMEMORYREGULATOR_H
Cppyy::TCppType_t
TCppScope_t TCppType_t
Definition:
Cppyy.h:13
PyROOT::TMemoryRegulator::RetrieveObject
static PyObject * RetrieveObject(TObject *object, Cppyy::TCppType_t klass)
lookup
, return old proxy if tracked
Definition:
TMemoryRegulator.cxx:231
PyROOT::TMemoryRegulator::ObjectMap_t
std::map< TObject *, PyObject * > ObjectMap_t
Definition:
TMemoryRegulator.h:45
PyROOT::TMemoryRegulator::RecursiveRemove
virtual void RecursiveRemove(TObject *object)
Recursively remove this object from a list.
Definition:
TMemoryRegulator.cxx:131
PyROOT::TMemoryRegulator::RegisterObject
static Bool_t RegisterObject(ObjectProxy *pyobj, TObject *object)
start tracking
proxied by
Definition:
TMemoryRegulator.cxx:195
PyROOT::TMemoryRegulator::fgWeakRefTable
static WeakRefMap_t * fgWeakRefTable
Definition:
TMemoryRegulator.h:49
Bool_t
bool Bool_t
Definition:
RtypesCore.h:59
PyROOT::TMemoryRegulator::~TMemoryRegulator
~TMemoryRegulator()
cleanup weakref cache
Definition:
TMemoryRegulator.cxx:120
PyROOT::TMemoryRegulator::fgObjectTable
static ObjectMap_t * fgObjectTable
Definition:
TMemoryRegulator.h:48
PyROOT::TMemoryRegulator::UnregisterObject
static Bool_t UnregisterObject(TObject *object)
stop tracking
, without notification
Definition:
TMemoryRegulator.cxx:215
PyROOT::TMemoryRegulator::TMemoryRegulator
TMemoryRegulator()
Definition:
TMemoryRegulator.cxx:105
PyROOT::TMemoryRegulator::ObjectEraseCallback
static PyObject * ObjectEraseCallback(PyObject *, PyObject *pyref)
Definition:
TMemoryRegulator.cxx:252
PyROOT
Definition:
TPyException.h:44
TObject
Mother of all ROOT objects.
Definition:
TObject.h:58
TObject.h
PyROOT::TMemoryRegulator::WeakRefMap_t
std::map< PyObject *, ObjectMap_t::iterator > WeakRefMap_t
Definition:
TMemoryRegulator.h:46
PyROOT::ObjectProxy
Definition:
ObjectProxy.h:28
PyObject
_object PyObject
Definition:
TPyArg.h:22
PyROOT::TMemoryRegulator
Definition:
TMemoryRegulator.h:24