Logo ROOT   6.08/07
Reference Guide
TObject.cxx
Go to the documentation of this file.
1 // @(#)root/base:$Id$
2 // Author: Rene Brun 26/12/94
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 /** \class TObject
13 \ingroup Base
14 
15 Mother of all ROOT objects.
16 
17 The TObject class provides default behaviour and protocol for all
18 objects in the ROOT system. It provides protocol for object I/O,
19 error handling, sorting, inspection, printing, drawing, etc.
20 Every object which inherits from TObject can be stored in the
21 ROOT collection classes.
22 
23 TObject's bits can be used as flags, bits 0 - 13 and 24-31 are
24 reserved as global bits while bits 14 - 23 can be used in different
25 class hierarchies (watch out for overlaps).
26 */
27 
28 #include <string.h>
29 #if !defined(WIN32) && !defined(__MWERKS__) && !defined(R__SOLARIS)
30 #include <strings.h>
31 #endif
32 #include <stdlib.h>
33 #include <stdio.h>
34 #include <sstream>
35 
36 #include "Varargs.h"
37 #include "Riostream.h"
38 #include "TObject.h"
39 #include "TClass.h"
40 #include "TGuiFactory.h"
41 #include "TMethod.h"
42 #include "TROOT.h"
43 #include "TError.h"
44 #include "TObjectTable.h"
45 #include "TVirtualPad.h"
46 #include "TInterpreter.h"
47 #include "TMemberInspector.h"
48 #include "TObjString.h"
49 #include "TRefTable.h"
50 #include "TProcessID.h"
51 
54 
56 
57 ////////////////////////////////////////////////////////////////////////////////
58 /// TObject constructor. It sets the two data words of TObject to their
59 /// initial values. The unique ID is set to 0 and the status word is
60 /// set depending if the object is created on the stack or allocated
61 /// on the heap. Depending on the ROOT environment variable "Root.MemStat"
62 /// (see TEnv) the object is added to the global TObjectTable for
63 /// bookkeeping.
64 
65 TObject::TObject() : fBits(kNotDeleted) //Need to leave FUniqueID unset
66 {
67  // This will be reported by valgrind as uninitialized memory reads for
68  // object created on the stack, use $ROOTSYS/etc/valgrind-root.supp
69  if (TStorage::FilledByObjectAlloc(&fUniqueID))
70  fBits |= kIsOnHeap;
71 
72  fUniqueID = 0;
73 
74  if (fgObjectStat) TObjectTable::AddObj(this);
75 }
76 
77 ////////////////////////////////////////////////////////////////////////////////
78 /// TObject copy ctor.
79 
81 {
82  fBits = obj.fBits;
83 
84  // This will be reported by valgrind as uninitialized memory reads for
85  // object created on the stack, use $ROOTSYS/etc/valgrind-root.supp
87  fBits |= kIsOnHeap;
88  else
89  fBits &= ~kIsOnHeap;
90 
91  fBits &= ~kIsReferenced;
92  fBits &= ~kCanDelete;
93 
94  //Set only after used in above call
95  fUniqueID = obj.fUniqueID; // when really unique don't copy
96 
98 }
99 
100 ////////////////////////////////////////////////////////////////////////////////
101 /// TObject assignment operator.
102 
104 {
105  if (this != &rhs) {
106  fUniqueID = rhs.fUniqueID; // when really unique don't copy
107  if (IsOnHeap()) { // test uses fBits so don't move next line
108  fBits = rhs.fBits;
109  fBits |= kIsOnHeap;
110  } else {
111  fBits = rhs.fBits;
112  fBits &= ~kIsOnHeap;
113  }
114  fBits &= ~kIsReferenced;
115  fBits &= ~kCanDelete;
116  }
117  return *this;
118 }
119 
120 ////////////////////////////////////////////////////////////////////////////////
121 /// Copy this to obj.
122 
123 void TObject::Copy(TObject &obj) const
124 {
125  obj.fUniqueID = fUniqueID; // when really unique don't copy
126  if (obj.IsOnHeap()) { // test uses fBits so don't move next line
127  obj.fBits = fBits;
128  obj.fBits |= kIsOnHeap;
129  } else {
130  obj.fBits = fBits;
131  obj.fBits &= ~kIsOnHeap;
132  }
133  obj.fBits &= ~kIsReferenced;
134  obj.fBits &= ~kCanDelete;
135 }
136 
137 ////////////////////////////////////////////////////////////////////////////////
138 /// TObject destructor. Removes object from all canvases and object browsers
139 /// if observer bit is on and remove from the global object table.
140 
142 {
143  // if (!TestBit(kNotDeleted))
144  // Fatal("~TObject", "object deleted twice");
145 
147  if (root) {
148  if (root->MustClean()) {
149  if (root == this) return;
150  if (TestBit(kMustCleanup)) {
151  root->GetListOfCleanups()->RecursiveRemove(this);
152  }
153  }
154  }
155 
156  fBits &= ~kNotDeleted;
157 
159 }
160 
161 ////////////////////////////////////////////////////////////////////////////////
162 /// Append graphics object to current pad. In case no current pad is set
163 /// yet, create a default canvas with the name "c1".
164 
166 {
167  if (!gPad) {
168  gROOT->MakeDefCanvas();
169  }
170  if (!gPad->IsEditable()) return;
172  gPad->GetListOfPrimitives()->Add(this,option);
173  gPad->Modified(kTRUE);
174 }
175 
176 ////////////////////////////////////////////////////////////////////////////////
177 /// Browse object. May be overridden for another default action
178 
180 {
181  //Inspect();
182  TClass::AutoBrowse(this,b);
183 }
184 
185 ////////////////////////////////////////////////////////////////////////////////
186 /// Returns name of class to which the object belongs.
187 
188 const char *TObject::ClassName() const
189 {
190  return IsA()->GetName();
191 }
192 
193 ////////////////////////////////////////////////////////////////////////////////
194 /// Make a clone of an object using the Streamer facility.
195 /// If the object derives from TNamed, this function is called
196 /// by TNamed::Clone. TNamed::Clone uses the optional argument to set
197 /// a new name to the newly created object.
198 ///
199 /// If the object class has a DirectoryAutoAdd function, it will be
200 /// called at the end of the function with the parameter gDirectory.
201 /// This usually means that the object will be appended to the current
202 /// ROOT directory.
203 
204 TObject *TObject::Clone(const char *) const
205 {
206  if (gDirectory) {
207  return gDirectory->CloneObject(this);
208  } else {
209  Fatal("Clone","No gDirectory set");
210  return 0;
211  }
212 }
213 
214 ////////////////////////////////////////////////////////////////////////////////
215 /// Compare abstract method. Must be overridden if a class wants to be able
216 /// to compare itself with other objects. Must return -1 if this is smaller
217 /// than obj, 0 if objects are equal and 1 if this is larger than obj.
218 
220 {
221  AbstractMethod("Compare");
222  return 0;
223 }
224 
225 ////////////////////////////////////////////////////////////////////////////////
226 /// Delete this object. Typically called as a command via the interpreter.
227 /// Normally use "delete" operator when object has been allocated on the heap.
228 
230 {
231  if (IsOnHeap()) {
232  // Delete object from CINT symbol table so it can not be used anymore.
233  // CINT object are always on the heap.
234  gInterpreter->DeleteGlobal(this);
235 
236  delete this;
237  }
238 }
239 
240 
241 ////////////////////////////////////////////////////////////////////////////////
242 /// Computes distance from point (px,py) to the object.
243 /// This member function must be implemented for each graphics primitive.
244 /// This default function returns a big number (999999).
245 
247 {
248  // AbstractMethod("DistancetoPrimitive");
249  return 999999;
250 }
251 
252 ////////////////////////////////////////////////////////////////////////////////
253 /// Default Draw method for all objects
254 
255 void TObject::Draw(Option_t *option)
256 {
257  AppendPad(option);
258 }
259 
260 ////////////////////////////////////////////////////////////////////////////////
261 /// Draw class inheritance tree of the class to which this object belongs.
262 /// If a class B inherits from a class A, description of B is drawn
263 /// on the right side of description of A.
264 /// Member functions overridden by B are shown in class A with a blue line
265 /// crossing-out the corresponding member function.
266 /// The following picture is the class inheritance tree of class TPaveLabel:
267 ///
268 /// \image html base_object.png
269 
270 void TObject::DrawClass() const
271 {
272  IsA()->Draw();
273 }
274 
275 ////////////////////////////////////////////////////////////////////////////////
276 /// Draw a clone of this object in the current pad
277 
279 {
280  TVirtualPad *pad = gROOT->GetSelectedPad();
281  TVirtualPad *padsav = gPad;
282  if (pad) pad->cd();
283 
284  TObject *newobj = Clone();
285  if (!newobj) return 0;
286  if (pad) {
287  if (strlen(option)) pad->GetListOfPrimitives()->Add(newobj,option);
288  else pad->GetListOfPrimitives()->Add(newobj,GetDrawOption());
289  pad->Modified(kTRUE);
290  pad->Update();
291  if (padsav) padsav->cd();
292  return newobj;
293  }
294  if (strlen(option)) newobj->Draw(option);
295  else newobj->Draw(GetDrawOption());
296  if (padsav) padsav->cd();
297 
298  return newobj;
299 }
300 
301 ////////////////////////////////////////////////////////////////////////////////
302 /// Dump contents of object on stdout.
303 /// Using the information in the object dictionary (class TClass)
304 /// each data member is interpreted.
305 /// If a data member is a pointer, the pointer value is printed
306 ///
307 /// The following output is the Dump of a TArrow object:
308 /// ~~~ {.cpp}
309 /// fAngle 0 Arrow opening angle (degrees)
310 /// fArrowSize 0.2 Arrow Size
311 /// fOption.*fData
312 /// fX1 0.1 X of 1st point
313 /// fY1 0.15 Y of 1st point
314 /// fX2 0.67 X of 2nd point
315 /// fY2 0.83 Y of 2nd point
316 /// fUniqueID 0 object unique identifier
317 /// fBits 50331648 bit field status word
318 /// fLineColor 1 line color
319 /// fLineStyle 1 line style
320 /// fLineWidth 1 line width
321 /// fFillColor 19 fill area color
322 /// fFillStyle 1001 fill area style
323 /// ~~~
324 
325 void TObject::Dump() const
326 {
327  // Get the actual address of the object.
328  const void *actual = IsA()->DynamicCast(TObject::Class(),this,kFALSE);
329  IsA()->Dump(actual);
330 }
331 
332 ////////////////////////////////////////////////////////////////////////////////
333 /// Execute method on this object with the given parameter string, e.g.
334 /// "3.14,1,\"text\"".
335 
336 void TObject::Execute(const char *method, const char *params, Int_t *error)
337 {
338  if (!IsA()) return;
339 
340  Bool_t must_cleanup = TestBit(kMustCleanup);
341 
342  gInterpreter->Execute(this, IsA(), method, params, error);
343 
344  if (gPad && must_cleanup) gPad->Modified();
345 }
346 
347 ////////////////////////////////////////////////////////////////////////////////
348 /// Execute method on this object with parameters stored in the TObjArray.
349 /// The TObjArray should contain an argv vector like:
350 /// ~~~ {.cpp}
351 /// argv[0] ... argv[n] = the list of TObjString parameters
352 /// ~~~
353 
354 void TObject::Execute(TMethod *method, TObjArray *params, Int_t *error)
355 {
356  if (!IsA()) return;
357 
358  Bool_t must_cleanup = TestBit(kMustCleanup);
359 
360  gInterpreter->Execute(this, IsA(), method, params, error);
361 
362  if (gPad && must_cleanup) gPad->Modified();
363 }
364 
365 
366 ////////////////////////////////////////////////////////////////////////////////
367 /// Execute action corresponding to an event at (px,py). This method
368 /// must be overridden if an object can react to graphics events.
369 
371 {
372  // AbstractMethod("ExecuteEvent");
373 }
374 
375 ////////////////////////////////////////////////////////////////////////////////
376 /// Must be redefined in derived classes.
377 /// This function is typically used with TCollections, but can also be used
378 /// to find an object by name inside this object.
379 
380 TObject *TObject::FindObject(const char *) const
381 {
382  return 0;
383 }
384 
385 ////////////////////////////////////////////////////////////////////////////////
386 /// Must be redefined in derived classes.
387 /// This function is typically used with TCollections, but can also be used
388 /// to find an object inside this object.
389 
391 {
392  return 0;
393 }
394 
395 ////////////////////////////////////////////////////////////////////////////////
396 /// Get option used by the graphics system to draw this object.
397 /// Note that before calling object.GetDrawOption(), you must
398 /// have called object.Draw(..) before in the current pad.
399 
401 {
402  if (!gPad) return "";
403 
404  TListIter next(gPad->GetListOfPrimitives());
405  TObject *obj;
406  while ((obj = next())) {
407  if (obj == this) return next.GetOption();
408  }
409  return "";
410 }
411 
412 ////////////////////////////////////////////////////////////////////////////////
413 /// Returns name of object. This default method returns the class name.
414 /// Classes that give objects a name should override this method.
415 
416 const char *TObject::GetName() const
417 {
418  return IsA()->GetName();
419 }
420 
421 ////////////////////////////////////////////////////////////////////////////////
422 /// Returns mime type name of object. Used by the TBrowser (via TGMimeTypes
423 /// class). Override for class of which you would like to have different
424 /// icons for objects of the same class.
425 
426 const char *TObject::GetIconName() const
427 {
428  return 0;
429 }
430 
431 ////////////////////////////////////////////////////////////////////////////////
432 /// Return the unique object id.
433 
435 {
436  return fUniqueID;
437 }
438 
439 ////////////////////////////////////////////////////////////////////////////////
440 /// Returns string containing info about the object at position (px,py).
441 /// This method is typically overridden by classes of which the objects
442 /// can report peculiarities for different positions.
443 /// Returned string will be re-used (lock in MT environment).
444 
445 char *TObject::GetObjectInfo(Int_t px, Int_t py) const
446 {
447  if (!gPad) return (char*)"";
448  static char info[64];
449  Float_t x = gPad->AbsPixeltoX(px);
450  Float_t y = gPad->AbsPixeltoY(py);
451  snprintf(info,64,"x=%g, y=%g",gPad->PadtoX(x),gPad->PadtoY(y));
452  return info;
453 }
454 
455 ////////////////////////////////////////////////////////////////////////////////
456 /// Returns title of object. This default method returns the class title
457 /// (i.e. description). Classes that give objects a title should override
458 /// this method.
459 
460 const char *TObject::GetTitle() const
461 {
462  return IsA()->GetTitle();
463 }
464 
465 
466 ////////////////////////////////////////////////////////////////////////////////
467 /// Execute action in response of a timer timing out. This method
468 /// must be overridden if an object has to react to timers.
469 
471 {
472  return kFALSE;
473 }
474 
475 ////////////////////////////////////////////////////////////////////////////////
476 /// Return hash value for this object.
477 
479 {
480  //return (ULong_t) this >> 2;
481  const void *ptr = this;
482  return TString::Hash(&ptr, sizeof(void*));
483 }
484 
485 ////////////////////////////////////////////////////////////////////////////////
486 /// Returns kTRUE if object inherits from class "classname".
487 
488 Bool_t TObject::InheritsFrom(const char *classname) const
489 {
490  return IsA()->InheritsFrom(classname);
491 }
492 
493 ////////////////////////////////////////////////////////////////////////////////
494 /// Returns kTRUE if object inherits from TClass cl.
495 
497 {
498  return IsA()->InheritsFrom(cl);
499 }
500 
501 ////////////////////////////////////////////////////////////////////////////////
502 /// Dump contents of this object in a graphics canvas.
503 /// Same action as Dump but in a graphical form.
504 /// In addition pointers to other objects can be followed.
505 ///
506 /// The following picture is the Inspect of a histogram object:
507 /// \image html base_inspect.png
508 
509 void TObject::Inspect() const
510 {
511  gGuiFactory->CreateInspectorImp(this, 400, 200);
512 }
513 
514 ////////////////////////////////////////////////////////////////////////////////
515 /// Returns kTRUE in case object contains browsable objects (like containers
516 /// or lists of other objects).
517 
519 {
520  return kFALSE;
521 }
522 
523 ////////////////////////////////////////////////////////////////////////////////
524 /// Default equal comparison (objects are equal if they have the same
525 /// address in memory). More complicated classes might want to override
526 /// this function.
527 
528 Bool_t TObject::IsEqual(const TObject *obj) const
529 {
530  return obj == this;
531 }
532 
533 ////////////////////////////////////////////////////////////////////////////////
534 /// The ls function lists the contents of a class on stdout. Ls output
535 /// is typically much less verbose then Dump().
536 
537 void TObject::ls(Option_t *option) const
538 {
540  std::cout <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << " : ";
541  std::cout << Int_t(TestBit(kCanDelete));
542  if (option && strstr(option,"noaddr")==0) {
543  std::cout <<" at: "<< this ;
544  }
545  std::cout << std::endl;
546 }
547 
548 ////////////////////////////////////////////////////////////////////////////////
549 /// This method must be overridden to handle object notification.
550 
552 {
553  return kFALSE;
554 }
555 
556 ////////////////////////////////////////////////////////////////////////////////
557 /// This method must be overridden if a class wants to paint itself.
558 /// The difference between Paint() and Draw() is that when a object
559 /// draws itself it is added to the display list of the pad in
560 /// which it is drawn (and automatically redrawn whenever the pad is
561 /// redrawn). While paint just draws the object without adding it to
562 /// the pad display list.
563 
565 {
566  // AbstractMethod("Paint");
567 }
568 
569 ////////////////////////////////////////////////////////////////////////////////
570 /// Pop on object drawn in a pad to the top of the display list. I.e. it
571 /// will be drawn last and on top of all other primitives.
572 
574 {
575  if (!gPad) return;
576 
577  if (this == gPad->GetListOfPrimitives()->Last()) return;
578 
579  TListIter next(gPad->GetListOfPrimitives());
580  TObject *obj;
581  while ((obj = next()))
582  if (obj == this) {
583  char *opt = StrDup(next.GetOption());
584  gPad->GetListOfPrimitives()->Remove((TObject*)this);
585  gPad->GetListOfPrimitives()->AddLast(this, opt);
586  gPad->Modified();
587  delete [] opt;
588  return;
589  }
590 }
591 
592 ////////////////////////////////////////////////////////////////////////////////
593 /// This method must be overridden when a class wants to print itself.
594 
596 {
597  std::cout <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << std::endl;
598 }
599 
600 ////////////////////////////////////////////////////////////////////////////////
601 /// Read contents of object with specified name from the current directory.
602 /// First the key with the given name is searched in the current directory,
603 /// next the key buffer is deserialized into the object.
604 /// The object must have been created before via the default constructor.
605 /// See TObject::Write().
606 
608 {
609  if (gDirectory) return gDirectory->ReadTObject(this,name);
610  else return 0;
611 }
612 
613 ////////////////////////////////////////////////////////////////////////////////
614 /// Recursively remove this object from a list. Typically implemented
615 /// by classes that can contain multiple references to a same object.
616 
618 {
619 }
620 
621 
622 ////////////////////////////////////////////////////////////////////////////////
623 /// Save this object in the file specified by filename.
624 ///
625 /// - if "filename" contains ".root" the object is saved in filename as root
626 /// binary file.
627 ///
628 /// - if "filename" contains ".xml" the object is saved in filename as a xml
629 /// ascii file.
630 ///
631 /// - if "filename" contains ".cc" the object is saved in filename as C code
632 /// independant from ROOT. The code is generated via SavePrimitive().
633 /// Specific code should be implemented in each object to handle this
634 /// option. Like in TF1::SavePrimitive().
635 ///
636 /// - otherwise the object is written to filename as a CINT/C++ script. The
637 /// C++ code to rebuild this object is generated via SavePrimitive(). The
638 /// "option" parameter is passed to SavePrimitive. By default it is an empty
639 /// string. It can be used to specify the Draw option in the code generated
640 /// by SavePrimitive.
641 ///
642 /// The function is available via the object context menu.
643 
644 void TObject::SaveAs(const char *filename, Option_t *option) const
645 {
646  //==============Save object as a root file===================================
647  if (filename && strstr(filename,".root")) {
648  if (gDirectory) gDirectory->SaveObjectAs(this,filename,"");
649  return;
650  }
651 
652  //==============Save object as a XML file====================================
653  if (filename && strstr(filename,".xml")) {
654  if (gDirectory) gDirectory->SaveObjectAs(this,filename,"");
655  return;
656  }
657 
658  //==============Save object as a JSON file================================
659  if (filename && strstr(filename,".json")) {
660  if (gDirectory) gDirectory->SaveObjectAs(this,filename,option);
661  return;
662  }
663 
664  //==============Save object as a C, ROOT independant, file===================
665  if (filename && strstr(filename,".cc")) {
666  char *fname = 0;
667  if (filename && strlen(filename) > 0) {
668  fname = (char*)filename;
669  } else {
670  fname = Form("%s.cc", GetName());
671  }
672  std::ofstream out;
673  out.open(fname, std::ios::out);
674  if (!out.good ()) {
675  Error("SaveAs", "cannot open file: %s", fname);
676  return;
677  }
678  ((TObject*)this)->SavePrimitive(out,"cc");
679  out.close();
680  Info("SaveAs", "cc file: %s has been generated", fname);
681  return;
682  }
683 
684  //==============Save as a C++ CINT file======================================
685  char *fname = 0;
686  if (filename && strlen(filename) > 0) {
687  fname = (char*)filename;
688  } else {
689  fname = Form("%s.C", GetName());
690  }
691  std::ofstream out;
692  out.open(fname, std::ios::out);
693  if (!out.good ()) {
694  Error("SaveAs", "cannot open file: %s", fname);
695  return;
696  }
697  out <<"{"<<std::endl;
698  out <<"//========= Macro generated from object: "<<GetName()<<"/"<<GetTitle()<<std::endl;
699  out <<"//========= by ROOT version"<<gROOT->GetVersion()<<std::endl;
700  ((TObject*)this)->SavePrimitive(out,option);
701  out <<"}"<<std::endl;
702  out.close();
703  Info("SaveAs", "C++ Macro file: %s has been generated", fname);
704 }
705 
706 ////////////////////////////////////////////////////////////////////////////////
707 /// Save a primitive as a C++ statement(s) on output stream "out".
708 
709 void TObject::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
710 {
711  out << "//Primitive: " << GetName() << "/" << GetTitle()
712  <<". You must implement " << ClassName() << "::SavePrimitive" << std::endl;
713 }
714 
715 ////////////////////////////////////////////////////////////////////////////////
716 /// Set drawing option for object. This option only affects
717 /// the drawing style and is stored in the option field of the
718 /// TObjOptLink supporting a TPad's primitive list (TList).
719 /// Note that it does not make sense to call object.SetDrawOption(option)
720 /// before having called object.Draw().
721 
723 {
724  if (!gPad || !option) return;
725 
726  TListIter next(gPad->GetListOfPrimitives());
727  delete gPad->FindObject("Tframe");
728  TObject *obj;
729  while ((obj = next()))
730  if (obj == this) {
731  next.SetOption(option);
732  return;
733  }
734 }
735 
736 ////////////////////////////////////////////////////////////////////////////////
737 /// Set or unset the user status bits as specified in f.
738 
740 {
741  if (set)
742  SetBit(f);
743  else
744  ResetBit(f);
745 }
746 
747 ////////////////////////////////////////////////////////////////////////////////
748 /// Set the unique object id.
749 
751 {
752  fUniqueID = uid;
753 }
754 
755 ////////////////////////////////////////////////////////////////////////////////
756 /// Set current style settings in this object
757 /// This function is called when either TCanvas::UseCurrentStyle
758 /// or TROOT::ForceStyle have been invoked.
759 
761 {
762 }
763 
764 ////////////////////////////////////////////////////////////////////////////////
765 /// Write this object to the current directory.
766 /// The data structure corresponding to this object is serialized.
767 /// The corresponding buffer is written to the current directory
768 /// with an associated key with name "name".
769 ///
770 /// Writing an object to a file involves the following steps:
771 ///
772 /// - Creation of a support TKey object in the current directory.
773 /// The TKey object creates a TBuffer object.
774 ///
775 /// - The TBuffer object is filled via the class::Streamer function.
776 ///
777 /// - If the file is compressed (default) a second buffer is created to
778 /// hold the compressed buffer.
779 ///
780 /// - Reservation of the corresponding space in the file by looking
781 /// in the TFree list of free blocks of the file.
782 ///
783 /// - The buffer is written to the file.
784 ///
785 /// Bufsize can be given to force a given buffer size to write this object.
786 /// By default, the buffersize will be taken from the average buffer size
787 /// of all objects written to the current file so far.
788 ///
789 /// If a name is specified, it will be the name of the key.
790 /// If name is not given, the name of the key will be the name as returned
791 /// by GetName().
792 ///
793 /// The option can be a combination of: kSingleKey, kOverwrite or kWriteDelete
794 /// Using the kOverwrite option a previous key with the same name is
795 /// overwritten. The previous key is deleted before writing the new object.
796 /// Using the kWriteDelete option a previous key with the same name is
797 /// deleted only after the new object has been written. This option
798 /// is safer than kOverwrite but it is slower.
799 /// The kSingleKey option is only used by TCollection::Write() to write
800 /// a container with a single key instead of each object in the container
801 /// with its own key.
802 ///
803 /// An object is read from the file into memory via TKey::Read() or
804 /// via TObject::Read().
805 ///
806 /// The function returns the total number of bytes written to the file.
807 /// It returns 0 if the object cannot be written.
808 
809 Int_t TObject::Write(const char *name, Int_t option, Int_t bufsize) const
810 {
811  TString opt = "";
812  if (option & kSingleKey) opt += "SingleKey";
813  if (option & kOverwrite) opt += "OverWrite";
814  if (option & kWriteDelete) opt += "WriteDelete";
815 
816  if (gDirectory) return gDirectory->WriteTObject(this,name,opt.Data(),bufsize);
817  else {
818  const char *objname = "no name specified";
819  if (name) objname = name;
820  else objname = GetName();
821  Error("Write","The current directory (gDirectory) is null. The object (%s) has not been written.",objname);
822  return 0;
823  }
824 }
825 
826 ////////////////////////////////////////////////////////////////////////////////
827 /// Write this object to the current directory. For more see the
828 /// const version of this method.
829 
830 Int_t TObject::Write(const char *name, Int_t option, Int_t bufsize)
831 {
832  return ((const TObject*)this)->Write(name, option, bufsize);
833 }
834 
835 ////////////////////////////////////////////////////////////////////////////////
836 /// Stream an object of class TObject.
837 
838 void TObject::Streamer(TBuffer &R__b)
839 {
840  if (IsA()->CanIgnoreTObjectStreamer()) return;
841  UShort_t pidf;
842  if (R__b.IsReading()) {
843  R__b.SkipVersion(); // Version_t R__v = R__b.ReadVersion(); if (R__v) { }
844  R__b >> fUniqueID;
845  R__b >> fBits;
846  fBits |= kIsOnHeap; // by definition de-serialized object is on heap
847  if (TestBit(kIsReferenced)) {
848  //if the object is referenced, we must read its old address
849  //and store it in the ProcessID map in gROOT
850  R__b >> pidf;
851  pidf += R__b.GetPidOffset();
852  TProcessID *pid = R__b.ReadProcessID(pidf);
853  if (pid) {
854  UInt_t gpid = pid->GetUniqueID();
855  if (gpid>=0xff) {
856  fUniqueID = fUniqueID | 0xff000000;
857  } else {
858  fUniqueID = ( fUniqueID & 0xffffff) + (gpid<<24);
859  }
860  pid->PutObjectWithID(this);
861  }
862  }
863  } else {
864  R__b.WriteVersion(TObject::IsA());
865  if (!TestBit(kIsReferenced)) {
866  R__b << fUniqueID;
867  R__b << fBits;
868  } else {
869  //if the object is referenced, we must save its address/file_pid
870  UInt_t uid = fUniqueID & 0xffffff;
871  R__b << uid;
872  R__b << fBits;
874  //add uid to the TRefTable if there is one
876  if(table) table->Add(uid, pid);
877  pidf = R__b.WriteProcessID(pid);
878  R__b << pidf;
879  }
880  }
881 }
882 
883 ////////////////////////////////////////////////////////////////////////////////
884 /// Interface to ErrorHandler (protected).
885 
886 void TObject::DoError(int level, const char *location, const char *fmt, va_list va) const
887 {
888  const char *classname = "UnknownClass";
889  if (TROOT::Initialized())
890  classname = ClassName();
891 
892  ::ErrorHandler(level, Form("%s::%s", classname, location), fmt, va);
893 }
894 
895 ////////////////////////////////////////////////////////////////////////////////
896 /// Issue info message. Use "location" to specify the method where the
897 /// warning occurred. Accepts standard printf formatting arguments.
898 
899 void TObject::Info(const char *location, const char *va_(fmt), ...) const
900 {
901  va_list ap;
902  va_start(ap, va_(fmt));
903  DoError(kInfo, location, va_(fmt), ap);
904  va_end(ap);
905 }
906 
907 ////////////////////////////////////////////////////////////////////////////////
908 /// Issue warning message. Use "location" to specify the method where the
909 /// warning occurred. Accepts standard printf formatting arguments.
910 
911 void TObject::Warning(const char *location, const char *va_(fmt), ...) const
912 {
913  va_list ap;
914  va_start(ap, va_(fmt));
915  DoError(kWarning, location, va_(fmt), ap);
916  va_end(ap);
917  if (TROOT::Initialized())
918  gROOT->Message(1001, this);
919 }
920 
921 ////////////////////////////////////////////////////////////////////////////////
922 /// Issue error message. Use "location" to specify the method where the
923 /// error occurred. Accepts standard printf formatting arguments.
924 
925 void TObject::Error(const char *location, const char *va_(fmt), ...) const
926 {
927  va_list ap;
928  va_start(ap, va_(fmt));
929  DoError(kError, location, va_(fmt), ap);
930  va_end(ap);
931  if (TROOT::Initialized())
932  gROOT->Message(1002, this);
933 }
934 
935 ////////////////////////////////////////////////////////////////////////////////
936 /// Issue system error message. Use "location" to specify the method where
937 /// the system error occurred. Accepts standard printf formatting arguments.
938 
939 void TObject::SysError(const char *location, const char *va_(fmt), ...) const
940 {
941  va_list ap;
942  va_start(ap, va_(fmt));
943  DoError(kSysError, location, va_(fmt), ap);
944  va_end(ap);
945  if (TROOT::Initialized())
946  gROOT->Message(1003, this);
947 }
948 
949 ////////////////////////////////////////////////////////////////////////////////
950 /// Issue fatal error message. Use "location" to specify the method where the
951 /// fatal error occurred. Accepts standard printf formatting arguments.
952 
953 void TObject::Fatal(const char *location, const char *va_(fmt), ...) const
954 {
955  va_list ap;
956  va_start(ap, va_(fmt));
957  DoError(kFatal, location, va_(fmt), ap);
958  va_end(ap);
959  if (TROOT::Initialized())
960  gROOT->Message(1004, this);
961 }
962 
963 ////////////////////////////////////////////////////////////////////////////////
964 /// Use this method to implement an "abstract" method that you don't
965 /// want to leave purely abstract.
966 
967 void TObject::AbstractMethod(const char *method) const
968 {
969  Warning(method, "this method must be overridden!");
970 }
971 
972 ////////////////////////////////////////////////////////////////////////////////
973 /// Use this method to signal that a method (defined in a base class)
974 /// may not be called in a derived class (in principle against good
975 /// design since a child class should not provide less functionality
976 /// than its parent, however, sometimes it is necessary).
977 
978 void TObject::MayNotUse(const char *method) const
979 {
980  Warning(method, "may not use this method");
981 }
982 
983 ////////////////////////////////////////////////////////////////////////////////
984 /// Use this method to declare a method obsolete. Specify as of which version
985 /// the method is obsolete and as from which version it will be removed.
986 
987 void TObject::Obsolete(const char *method, const char *asOfVers, const char *removedFromVers) const
988 {
989  const char *classname = "UnknownClass";
990  if (TROOT::Initialized())
991  classname = ClassName();
992 
993  ::Obsolete(Form("%s::%s", classname, method), asOfVers, removedFromVers);
994 }
995 
996 ////////////////////////////////////////////////////////////////////////////////
997 /// Get status of object stat flag.
998 
1000 {
1001  return fgObjectStat;
1002 }
1003 ////////////////////////////////////////////////////////////////////////////////
1004 /// Turn on/off tracking of objects in the TObjectTable.
1005 
1007 {
1008  fgObjectStat = stat;
1009 }
1010 
1011 ////////////////////////////////////////////////////////////////////////////////
1012 /// Return destructor only flag
1013 
1015 {
1016  return fgDtorOnly;
1017 }
1018 
1019 ////////////////////////////////////////////////////////////////////////////////
1020 /// Set destructor only flag
1021 
1022 void TObject::SetDtorOnly(void *obj)
1023 {
1024  fgDtorOnly = (Long_t) obj;
1025 }
1026 
1027 ////////////////////////////////////////////////////////////////////////////////
1028 /// Operator delete
1029 
1030 void TObject::operator delete(void *ptr)
1031 {
1032  if ((Long_t) ptr != fgDtorOnly)
1034  else
1035  fgDtorOnly = 0;
1036 }
1037 
1038 ////////////////////////////////////////////////////////////////////////////////
1039 /// Operator delete []
1040 
1041 void TObject::operator delete[](void *ptr)
1042 {
1043  if ((Long_t) ptr != fgDtorOnly)
1045  else
1046  fgDtorOnly = 0;
1047 }
1048 
1049 #ifdef R__SIZEDDELETE
1050 ////////////////////////////////////////////////////////////////////////////////
1051 /// Operator delete for sized deallocation.
1052 
1053 void TObject::operator delete(void *ptr, size_t size)
1054 {
1055  if ((Long_t) ptr != fgDtorOnly)
1056  TStorage::ObjectDealloc(ptr, size);
1057  else
1058  fgDtorOnly = 0;
1059 }
1060 
1061 ////////////////////////////////////////////////////////////////////////////////
1062 /// Operator delete [] for sized deallocation.
1063 
1064 void TObject::operator delete[](void *ptr, size_t size)
1065 {
1066  if ((Long_t) ptr != fgDtorOnly)
1067  TStorage::ObjectDealloc(ptr, size);
1068  else
1069  fgDtorOnly = 0;
1070 }
1071 #endif
1072 
1073 ////////////////////////////////////////////////////////////////////////////////
1074 /// Print value overload
1075 
1076 std::string cling::printValue(TObject *val) {
1077  std::ostringstream strm;
1078  strm << "Name: " << val->GetName() << " Title: " << val->GetTitle();
1079  return strm.str();
1080 }
1081 
1082 #ifdef R__PLACEMENTDELETE
1083 ////////////////////////////////////////////////////////////////////////////////
1084 /// Only called by placement new when throwing an exception.
1085 
1086 void TObject::operator delete(void *ptr, void *vp)
1087 {
1088  TStorage::ObjectDealloc(ptr, vp);
1089 }
1090 
1091 ////////////////////////////////////////////////////////////////////////////////
1092 /// Only called by placement new[] when throwing an exception.
1093 
1094 void TObject::operator delete[](void *ptr, void *vp)
1095 {
1096  TStorage::ObjectDealloc(ptr, vp);
1097 }
1098 #endif
virtual void DoError(int level, const char *location, const char *fmt, va_list va) const
Interface to ErrorHandler (protected).
Definition: TObject.cxx:886
virtual void SysError(const char *method, const char *msgfmt,...) const
Issue system error message.
Definition: TObject.cxx:939
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
Definition: TObject.cxx:830
virtual UInt_t GetUniqueID() const
Return the unique object id.
Definition: TObject.cxx:434
Bool_t IsReading() const
Definition: TBuffer.h:83
object has not been deleted
Definition: TObject.h:69
UInt_t fUniqueID
object unique identifier
Definition: TObject.h:40
void PutObjectWithID(TObject *obj, UInt_t uid=0)
stores the object at the uid th slot in the table of objects The object uniqued is set as well as its...
Definition: TProcessID.cxx:344
An array of TObjects.
Definition: TObjArray.h:39
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:899
ROOT top level object description.
Definition: TROOT.h:104
virtual ULong_t Hash() const
Return hash value for this object.
Definition: TObject.cxx:478
TSeqCollection * GetListOfCleanups() const
Definition: TROOT.h:256
virtual TObject * DrawClone(Option_t *option="") const
Draw a clone of this object in the current pad.
Definition: TObject.cxx:278
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Computes distance from point (px,py) to the object.
Definition: TObject.cxx:246
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
virtual const char * GetIconName() const
Returns mime type name of object.
Definition: TObject.cxx:426
virtual void Update()=0
unsigned short UShort_t
Definition: RtypesCore.h:36
Bool_t TestBit(UInt_t f) const
Definition: TObject.h:157
static void SetDtorOnly(void *obj)
Set destructor only flag.
Definition: TObject.cxx:1022
Buffer base class used for serializing objects.
Definition: TBuffer.h:42
static void SetObjectStat(Bool_t stat)
Turn on/off tracking of objects in the TObjectTable.
Definition: TObject.cxx:1006
#define gROOT
Definition: TROOT.h:364
void RemoveQuietly(TObject *obj)
Remove an object from the object table.
Basic string class.
Definition: TString.h:137
virtual void Browse(TBrowser *b)
Browse object. May be overridden for another default action.
Definition: TObject.cxx:179
virtual Int_t Add(Int_t uid, TProcessID *context=0)
Add a new uid to the table.
Definition: TRefTable.cxx:88
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Definition: TObject.cxx:255
#define gInterpreter
Definition: TInterpreter.h:517
virtual void UseCurrentStyle()
Set current style settings in this object This function is called when either TCanvas::UseCurrentStyl...
Definition: TObject.cxx:760
virtual UShort_t GetPidOffset() const =0
virtual void Print(Option_t *option="") const
This method must be overridden when a class wants to print itself.
Definition: TObject.cxx:595
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)=0
const char * Class
Definition: TXMLSetup.cxx:64
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Returns string containing info about the object at position (px,py).
Definition: TObject.cxx:445
virtual TVirtualPad * cd(Int_t subpadnumber=0)=0
Iterator of linked list.
Definition: TList.h:187
UInt_t Hash(ECaseCompare cmp=kExact) const
Return hash value.
Definition: TString.cxx:606
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:739
static Long_t GetDtorOnly()
Return destructor only flag.
Definition: TObject.cxx:1014
overwrite existing object with same name
Definition: TObject.h:77
if object in a list can be deleted
Definition: TObject.h:56
virtual void RecursiveRemove(TObject *obj)
Recursively remove this object from a list.
Definition: TObject.cxx:617
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
Definition: TObject.cxx:165
object is on heap
Definition: TObject.h:68
static Long_t fgDtorOnly
object for which to call dtor only (i.e. no delete)
Definition: TObject.h:43
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition: TObject.cxx:188
Double_t x[n]
Definition: legend1.C:17
virtual TProcessID * ReadProcessID(UShort_t pidf)=0
Return the current Process-ID.
Definition: TBuffer.cxx:313
const Int_t kSysError
Definition: TError.h:43
virtual void SaveAs(const char *filename="", Option_t *option="") const
Save this object in the file specified by filename.
Definition: TObject.cxx:644
virtual void Copy(TObject &object) const
Copy this to obj.
Definition: TObject.cxx:123
virtual Bool_t Notify()
This method must be overridden to handle object notification.
Definition: TObject.cxx:551
static Bool_t Initialized()
Return kTRUE if the TROOT object has been initialized.
Definition: TROOT.cxx:2626
const Int_t kFatal
Definition: TError.h:44
virtual Bool_t HandleTimer(TTimer *timer)
Execute action in response of a timer timing out.
Definition: TObject.cxx:470
virtual void Pop()
Pop on object drawn in a pad to the top of the display list.
Definition: TObject.cxx:573
#define va_(arg)
Definition: Varargs.h:41
void MayNotUse(const char *method) const
Use this method to signal that a method (defined in a base class) may not be called in a derived clas...
Definition: TObject.cxx:978
virtual Int_t Read(const char *name)
Read contents of object with specified name from the current directory.
Definition: TObject.cxx:607
TObject & operator=(const TObject &rhs)
TObject assignment operator.
Definition: TObject.cxx:103
A TProcessID identifies a ROOT job in a unique way in time and space.
Definition: TProcessID.h:73
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:59
R__EXTERN TGuiFactory * gGuiFactory
Definition: TGuiFactory.h:68
void Obsolete(const char *method, const char *asOfVers, const char *removedFromVers) const
Use this method to declare a method obsolete.
Definition: TObject.cxx:987
TObject()
TObject constructor.
Definition: TObject.cxx:65
virtual UShort_t WriteProcessID(TProcessID *pid)=0
Always return 0 (current processID).
Definition: TBuffer.cxx:322
virtual void ls(Option_t *option="") const
The ls function lists the contents of a class on stdout.
Definition: TObject.cxx:537
virtual Bool_t IsEqual(const TObject *obj) const
Default equal comparison (objects are equal if they have the same address in memory).
Definition: TObject.cxx:528
virtual void DrawClass() const
Draw class inheritance tree of the class to which this object belongs.
Definition: TObject.cxx:270
virtual Option_t * GetDrawOption() const
Get option used by the graphics system to draw this object.
Definition: TObject.cxx:400
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
Definition: TObject.cxx:750
R__EXTERN TROOT * gROOTLocal
Definition: TROOT.h:361
virtual void Delete(Option_t *option="")
Delete this object.
Definition: TObject.cxx:229
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:41
virtual void RecursiveRemove(TObject *obj)
Remove object from this collection and recursively remove the object from all other objects (and coll...
std::string printValue(const TDatime *val)
Print a TDatime at the prompt.
Definition: TDatime.cxx:449
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
Definition: TObject.cxx:380
static TProcessID * GetProcessWithUID(const TObject *obj)
static function returning a pointer to TProcessID with its pid encoded in the highest byte of obj->Ge...
Definition: TProcessID.cxx:267
const Int_t kInfo
Definition: TError.h:39
Bool_t MustClean() const
Definition: TROOT.h:301
virtual void Execute(const char *method, const char *params, Int_t *error=0)
Execute method on this object with the given parameter string, e.g.
Definition: TObject.cxx:336
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:488
virtual void Inspect() const
Dump contents of this object in a graphics canvas.
Definition: TObject.cxx:509
unsigned int UInt_t
Definition: RtypesCore.h:42
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:925
char * Form(const char *fmt,...)
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:57
virtual TInspectorImp * CreateInspectorImp(const TObject *obj, UInt_t width, UInt_t height)
Create a batch version of TInspectorImp.
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
Definition: TROOT.cxx:2618
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:81
virtual TList * GetListOfPrimitives() const =0
const Int_t kWarning
Definition: TError.h:40
virtual Int_t Compare(const TObject *obj) const
Compare abstract method.
Definition: TObject.cxx:219
write collection with single key
Definition: TObject.h:76
static Bool_t GetObjectStat()
Get status of object stat flag.
Definition: TObject.cxx:999
if object destructor must call RecursiveRemove()
Definition: TObject.h:57
static void AddObj(TObject *obj)
Add an object to the global object table gObjectTable.
R__EXTERN TObjectTable * gObjectTable
Definition: TObjectTable.h:84
char * StrDup(const char *str)
Duplicate the string str.
Definition: TString.cxx:2514
UInt_t fBits
bit field status word
Definition: TObject.h:41
long Long_t
Definition: RtypesCore.h:50
virtual void Modified(Bool_t flag=1)=0
virtual void Paint(Option_t *option="")
This method must be overridden if a class wants to paint itself.
Definition: TObject.cxx:564
static Bool_t fgObjectStat
if true keep track of objects in TObjectTable
Definition: TObject.h:44
Bool_t IsOnHeap() const
Definition: TObject.h:119
#define ClassImp(name)
Definition: Rtypes.h:279
double f(double x)
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to an event at (px,py).
Definition: TObject.cxx:370
static TRefTable * GetRefTable()
Static function returning the current TRefTable.
Definition: TRefTable.cxx:287
virtual void Dump() const
Dump contents of object on stdout.
Definition: TObject.cxx:325
unsigned long ULong_t
Definition: RtypesCore.h:51
virtual ~TObject()
TObject destructor.
Definition: TObject.cxx:141
A TRefTable maintains the association between a referenced object and the parent object supporting th...
Definition: TRefTable.h:37
Double_t y[n]
Definition: legend1.C:17
virtual Option_t * GetOption() const
Definition: TObject.h:108
Mother of all ROOT objects.
Definition: TObject.h:37
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
Definition: TObject.cxx:204
virtual const char * GetTitle() const
Returns title of object.
Definition: TObject.cxx:460
void ErrorHandler(int level, const char *location, const char *fmt, va_list va)
General error handler function. It calls the user set error handler.
Definition: TError.cxx:202
virtual void Add(TObject *obj)
Definition: TList.h:81
Each ROOT class (see TClass) has a linked list of methods.
Definition: TMethod.h:40
const Int_t kError
Definition: TError.h:41
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
if object is referenced by a TRef or TRefArray
Definition: TObject.h:59
#define snprintf
Definition: civetweb.c:822
#define gPad
Definition: TVirtualPad.h:289
virtual Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects)...
Definition: TObject.cxx:518
#define gDirectory
Definition: TDirectory.h:221
void ResetBit(UInt_t f)
Definition: TObject.h:156
static Bool_t FilledByObjectAlloc(UInt_t *member)
Definition: TStorage.h:89
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
Definition: TObject.cxx:953
virtual void SetDrawOption(Option_t *option="")
Set drawing option for object.
Definition: TObject.cxx:722
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:416
const Bool_t kTRUE
Definition: Rtypes.h:91
write object, then delete previous key with same name
Definition: TObject.h:78
void AbstractMethod(const char *method) const
Use this method to implement an "abstract" method that you don&#39;t want to leave purely abstract...
Definition: TObject.cxx:967
static void ObjectDealloc(void *vp)
Used to deallocate a TObject on the heap (via TObject::operator delete()).
Definition: TStorage.cxx:354
static Int_t AutoBrowse(TObject *obj, TBrowser *browser)
Browse external object inherited from TObject.
Definition: TClass.cxx:1886
char name[80]
Definition: TGX11.cxx:109
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:911
virtual void SkipVersion(const TClass *cl=0)=0
const char * Data() const
Definition: TString.h:349
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition: TObject.cxx:709