LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
lsst.gdb.afw.printers_oldgdb.Printer Class Reference
Inheritance diagram for lsst.gdb.afw.printers_oldgdb.Printer:

Public Member Functions

def __init__
 
def add
 
def __call__
 

Static Public Member Functions

def get_basic_type
 

Public Attributes

 name
 
 subprinters
 
 lookup
 
 enabled
 
 compiled_rx
 

Detailed Description

Definition at line 238 of file printers_oldgdb.py.

Constructor & Destructor Documentation

def lsst.gdb.afw.printers_oldgdb.Printer.__init__ (   self,
  name 
)

Member Function Documentation

def lsst.gdb.afw.printers_oldgdb.Printer.__call__ (   self,
  val 
)

Definition at line 267 of file printers_oldgdb.py.

268  def __call__(self, val):
269  typename = self.get_basic_type(val.type)
270  if not typename:
271  return None
272 
273  # All the types we match are template types, so we can use a
274  # dictionary.
275  match = self.compiled_rx.match(typename)
276  if not match:
277  return None
278 
279  basename = match.group(1)
280  if basename in self.lookup:
281  return self.lookup[basename].invoke(val)
282 
283  # Cannot find a pretty printer. Return None.
284  return None
285 
286 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
def lsst.gdb.afw.printers_oldgdb.Printer.add (   self,
  name,
  function 
)

Definition at line 247 of file printers_oldgdb.py.

248  def add(self, name, function):
249  # A small sanity check.
250  # FIXME
251  if not self.compiled_rx.match(name + '<>'):
252  raise ValueError, 'libstdc++ programming error: "%s" does not match' % name
253  printer = RxPrinter(name, function)
254  self.subprinters.append(printer)
255  self.lookup[name] = printer
def lsst.gdb.afw.printers_oldgdb.Printer.get_basic_type (   type)
static

Definition at line 257 of file printers_oldgdb.py.

258  def get_basic_type(type):
259  # If it points to a reference, get the reference.
260  if type.code == gdb.TYPE_CODE_REF:
261  type = type.target ()
262 
263  # Get the unqualified type, stripped of typedefs.
264  type = type.unqualified ().strip_typedefs ()
265 
266  return type.tag

Member Data Documentation

lsst.gdb.afw.printers_oldgdb.Printer.compiled_rx

Definition at line 245 of file printers_oldgdb.py.

lsst.gdb.afw.printers_oldgdb.Printer.enabled

Definition at line 244 of file printers_oldgdb.py.

lsst.gdb.afw.printers_oldgdb.Printer.lookup

Definition at line 243 of file printers_oldgdb.py.

lsst.gdb.afw.printers_oldgdb.Printer.name

Definition at line 241 of file printers_oldgdb.py.

lsst.gdb.afw.printers_oldgdb.Printer.subprinters

Definition at line 242 of file printers_oldgdb.py.


The documentation for this class was generated from the following file: