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 | List of all members
lsst.gdb.afw.printers.GdbOptionParser.PrintCitizenCommand Class Reference
Inheritance diagram for lsst.gdb.afw.printers.GdbOptionParser.PrintCitizenCommand:

Public Member Functions

def __init__
 
def invoke
 

Detailed Description

Print a Citizen
    Usage: show citizen <obj>

Definition at line 323 of file printers.py.

Constructor & Destructor Documentation

def lsst.gdb.afw.printers.GdbOptionParser.PrintCitizenCommand.__init__ (   self)

Definition at line 328 of file printers.py.

329  def __init__ (self):
330  super (PrintCitizenCommand, self).__init__ ("show citizen",
331  gdb.COMMAND_DATA,
332  gdb.COMPLETE_SYMBOL)

Member Function Documentation

def lsst.gdb.afw.printers.GdbOptionParser.PrintCitizenCommand.invoke (   self,
  args,
  fromTty 
)

Definition at line 333 of file printers.py.

334  def invoke (self, args, fromTty):
335  self.dont_repeat()
336 
337  parser = GdbOptionParser("show citizen")
338  if False:
339  parser.add_option("object", help="The object in question")
340 
341  opts = parser.parse_args(args)
342  if opts.help:
343  return
344  else:
345  opts, args = parser.parse_args(args)
346  if opts.help:
347  return
348 
349  if not args:
350  raise gdb.GdbError("Please specify an object")
351  opts.object = args.pop(0)
352 
353  if args:
354  raise gdb.GdbError("Unrecognised trailing arguments: %s" % " ".join(args))
355 
356  var = gdb.parse_and_eval(opts.object)
357  if re.search(r"shared_ptr<", str(var.type)):
358  var = var["px"]
359 
360  if var.type.code != gdb.TYPE_CODE_PTR:
361  var = var.address
362 
363  citizen = var.dynamic_cast(gdb.lookup_type("lsst::daf::base::Citizen").pointer())
364 
365  if not citizen:
366  raise gdb.GdbError("Failed to cast %s to Citizen -- is it a subclass?" % opts.object)
367 
368  citizen = citizen.dereference()
369 
370  print citizen
371 
PrintCitizenCommand()

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