![]() |
|
|||
File indexing completed on 2025-07-11 08:46:37
0001 // @(#)root/io:$Id$ 0002 // Author: Philippe Canal July, 2008 0003 0004 /************************************************************************* 0005 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * 0006 * All rights reserved. * 0007 * * 0008 * For the licensing terms see $ROOTSYS/LICENSE. * 0009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 0010 *************************************************************************/ 0011 0012 #ifndef ROOT_TVirtualObject 0013 #define ROOT_TVirtualObject 0014 0015 /** 0016 \class TVirtualObject 0017 \ingroup IO 0018 0019 Wrapper around an object and giving indirect access to its content 0020 even if the object is not of a class in the Cint/Reflex dictionary. 0021 */ 0022 0023 #include "TClassRef.h" 0024 0025 0026 class TVirtualObject { 0027 private: 0028 0029 TVirtualObject(const TVirtualObject&) = delete; 0030 TVirtualObject &operator=(const TVirtualObject&) = delete; 0031 0032 public: 0033 TClassRef fClass; 0034 void *fObject; 0035 0036 TVirtualObject(TClass *cl) : fClass(cl), fObject(cl ? cl->New() : nullptr) { } 0037 ~TVirtualObject() { if (fClass) fClass->Destructor(fObject); } 0038 0039 0040 TClass *GetClass() const { return fClass; } 0041 void *GetObject() const { return fObject; } 0042 0043 }; 0044 0045 #endif // ROOT_TVirtualObject
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |