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