Logo ROOT   master
Reference Guide
TMemberStreamer.h
Go to the documentation of this file.
1 // @(#)root/meta:$Id$
2 // Author: Victor Perev and Philippe Canal 08/05/02
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2003, Rene Brun, Fons Rademakers and al. *
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 #ifndef ROOT_TMemberStreamer
13 #define ROOT_TMemberStreamer
14 
15 #include "TClassRef.h"
16 
17 //////////////////////////////////////////////////////////////////////////
18 // //
19 // TMemberStreamer is used to stream a data member. //
20 // //
21 // The address passed to operator() will be the address of the data //
22 // member. //
23 // //
24 //////////////////////////////////////////////////////////////////////////
25 
27 protected:
29 
30 public:
33  TMemberStreamer &operator=(const TMemberStreamer &rhs) { fStreamer = rhs.fStreamer; return *this; }
34 
35  virtual ~TMemberStreamer(){};
36 
37  virtual void SetOnFileClass( const TClass* cl ) { fOnFileClass = const_cast<TClass*>(cl); }
38  virtual const TClass* GetOnFileClass() const { return fOnFileClass; }
39 
40  virtual void operator()(TBuffer &b, void *pmember, Int_t size=0)
41  {
42  // The address passed to operator() will be the address of the data member.
43  // If the data member is a variable size array, 'size' is the number of elements
44  // to read/write
45 
46  (*fStreamer)(b,pmember,size);
47  }
48 
49 private:
52 };
53 
54 #endif
TMemberStreamer & operator=(const TMemberStreamer &rhs)
Buffer base class used for serializing objects.
Definition: TBuffer.h:42
TClassRef fOnFileClass
TMemberStreamer(MemberStreamerFunc_t pointer)
void(* MemberStreamerFunc_t)(TBuffer &, void *, Int_t)
Definition: Rtypes.h:72
virtual ~TMemberStreamer()
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
virtual const TClass * GetOnFileClass() const
TMemberStreamer(const TMemberStreamer &rhs)
MemberStreamerFunc_t fStreamer
TClassRef is used to implement a permanent reference to a TClass object.
Definition: TClassRef.h:28
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
virtual void operator()(TBuffer &b, void *pmember, Int_t size=0)
virtual void SetOnFileClass(const TClass *cl)