1 #include "pybind11/pybind11.h"
2 #include "pybind11/stl.h"
6 namespace py = pybind11;
13 py::module mod(
"citizen");
15 py::class_<Citizen, std::shared_ptr<Citizen>> cls(mod,
"Citizen");
20 cls.def_static(
"census", (
const std::vector<const Citizen *> *(*)()) & Citizen::census,
21 py::return_value_policy::reference);
26 cls.def_static(
"census", (std::vector<Citizen const *>
const *(*)()) & Citizen::census,
27 py::return_value_policy::reference);
unsigned long memId
Type of the block's ID.
memId getId() const
Return the Citizen's ID.
void markPersistent(void)
Mark a Citizen as persistent and not destroyed until process end.
std::string repr() const
Return a string representation of a Citizen.
static memId setNewCallbackId(memId id)
Call the NewCallback when block is allocated.
static memId setDeleteCallbackId(memId id)
Call the current DeleteCallback when block is deleted.
static const std::vector< const Citizen * > * census()
Return a (newly allocated) std::vector of active Citizens sorted by ID.
static memId getNextMemId()
Return the memId of the next object to be allocated.