LSSTApplications  11.0-24-g0a022a1,14.0+77,15.0,15.0+1
LSSTDataManagementBasePackage
Classes | Variables
Citizen.cc File Reference

Implementation of Citizen. More...

#include <ctype.h>
#include <cerrno>
#include <iostream>
#include <memory>
#include <boost/format.hpp>
#include "lsst/daf/base/Citizen.h"
#include "lsst/pex/exceptions.h"
#include "lsst/utils/Demangle.h"

Go to the source code of this file.

Classes

class  CitizenInit
 Called once when the memory system is being initialised. More...
 

Functions

callbacks

Set the New/Delete callback functions; in each case the previously installed callback is returned.

These callback functions return a value which is Added to the previously registered id.

The default callback functions are called default{New,Delete}Callback; you may want to set a break point in these callbacks from your favourite debugger

dafBase::Citizen::memId defaultNewCallback (dafBase::Citizen::memId const cid)
 Default callbacks. More...
 
dafBase::Citizen::memId defaultDeleteCallback (dafBase::Citizen const *ptr)
 Default DeleteCallback. More...
 
dafBase::Citizen::memId defaultCorruptionCallback (dafBase::Citizen const *ptr)
 Default CorruptionCallback. More...
 

Variables

CitizenInit one
 

Detailed Description

Implementation of Citizen.

Definition in file Citizen.cc.

Function Documentation

◆ defaultCorruptionCallback()

dafBase::Citizen::memId defaultCorruptionCallback ( dafBase::Citizen const *  ptr)

Default CorruptionCallback.

Parameters
ptrAbout-to-be deleted Citizen

Definition at line 466 of file Citizen.cc.

467  {
469  str(boost::format("Citizen \"%s\" is corrupted") % ptr->repr()));
470 
471  return ptr->getId(); // NOTREACHED
472 }
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:134
#define LSST_EXCEPT(type,...)
Create an exception with a given type and message and optionally other arguments (dependent on the ty...
Definition: Exception.h:46

◆ defaultDeleteCallback()

dafBase::Citizen::memId defaultDeleteCallback ( dafBase::Citizen const *  ptr)

Default DeleteCallback.

Parameters
ptrAbout-to-be deleted Citizen

Definition at line 457 of file Citizen.cc.

458  {
459  static int dId = 0; // how much to incr memId
460  std::cerr << boost::format("Deleting memId %s\n") % ptr->repr();
461 
462  return dId;
463 }
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:134

◆ defaultNewCallback()

dafBase::Citizen::memId defaultNewCallback ( dafBase::Citizen::memId const  cid)

Default callbacks.

Note that these may well be the target of debugger breakpoints, so e.g. dId may well be changed behind our back Default NewCallback

Parameters
cidID for just-allocated Citizen

Definition at line 447 of file Citizen.cc.

449  {
450  static int dId = 0; // how much to incr memId
451  std::cerr << boost::format("Allocating memId %d\n") % cid;
452 
453  return dId;
454 }
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:134

Variable Documentation

◆ one

Definition at line 156 of file Citizen.cc.