User Tools

Site Tools


root.clearobjects

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

root.clearobjects [2010/07/06 06:39] (current)
jochen created
Line 1: Line 1:
 +====== 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'​)'​) =====
 +<​file>​ ROOT::​ClearObjects ​ - delete multiple objects
 + 
 + ​FORMAT: ​      ​xff.ClearObjects(dspec);​
 + 
 + Input fields:
 + 
 +       ​dspec ​      ​(partial) filename (or pattern)
 + 
 + No output fields.</​file>​
 +
 +===== Examples =====
 +==== Clearing all SDMs ====
 +To clear all currently loaded [[xff - SDM format|SDM objects]], one would use the syntax
 +
 +<code matlab xff_root_clearobjects_x1.m>​% get root object handle
 +root = xff;
 +
 +% call clear with simple extension
 +root.ClearObjects('​sdm'​);</​code>​
 +
 +==== Clearing all colin-related objects ====
 +To clear all objects that start with ''​colin_''​ the following syntax will do:
 +
 +<code matlab xff_root_clearobjects_x2.m>​% get root object handle
 +root = xff;
 +
 +% call clear with pattern
 +root.ClearObject('​colin_*'​);</​code>​
 +
 +===== 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