User Tools

Site Tools


root.clearobjects

root.ClearObjects

This method clears several objects given by either a partial name or pattern or a simple extension.

Motivation

Sometimes it can happen that, during a scripted process, several orphaned objects remain in the global storage (e.g. when a multi-study design matrix is computed and an error occurs during the script). In such cases, one way to free up several objects at once is by using this method.

Method reference ('root.Help('ClearObjects')')

 ROOT::ClearObjects  - delete multiple objects
 
 FORMAT:       xff.ClearObjects(dspec);
 
 Input fields:
 
       dspec       (partial) filename (or pattern)
 
 No output fields.

Examples

Clearing all SDMs

To clear all currently loaded SDM objects, one would use the syntax

xff_root_clearobjects_x1.m
% get root object handle
root = xff;
 
% call clear with simple extension
root.ClearObjects('sdm');

To clear all objects that start with colin_ the following syntax will do:

xff_root_clearobjects_x2.m
% get root object handle
root = xff;
 
% call clear with pattern
root.ClearObject('colin_*');

Notes

Please note that this method should not be used as part of a function (or batch file) that is integrated into a larger context, as it is possible to clear objects that are still in use by calling methods (or other processes). This method has rather been implemented for simplify the development of methods, so that during debugging it is relatively easy to remove certain types (name patterns) of objects.

root.clearobjects.txt · Last modified: 2010/07/06 06:39 by jochen