Logo ROOT  
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 "Rtypes.h"
16#include "TClassRef.h"
17
18//////////////////////////////////////////////////////////////////////////
19// //
20// TMemberStreamer is used to stream a data member. //
21// //
22// The address passed to operator() will be the address of the data //
23// member. //
24// //
25//////////////////////////////////////////////////////////////////////////
26
28protected:
30
31public:
34 TMemberStreamer &operator=(const TMemberStreamer &rhs) { fStreamer = rhs.fStreamer; return *this; }
35
36 virtual ~TMemberStreamer(){};
37
38 virtual void SetOnFileClass( const TClass* cl ) { fOnFileClass = const_cast<TClass*>(cl); }
39 virtual const TClass* GetOnFileClass() const { return fOnFileClass; }
40
41 virtual void operator()(TBuffer &b, void *pmember, Int_t size=0)
42 {
43 // The address passed to operator() will be the address of the data member.
44 // If the data member is a variable size array, 'size' is the number of elements
45 // to read/write
46
47 (*fStreamer)(b,pmember,size);
48 }
49
50private:
53};
54
55#endif
#define b(i)
Definition: RSha256.hxx:100
int Int_t
Definition: RtypesCore.h:41
void(* MemberStreamerFunc_t)(TBuffer &, void *, Int_t)
Definition: Rtypes.h:72
Buffer base class used for serializing objects.
Definition: TBuffer.h:42
TClassRef is used to implement a permanent reference to a TClass object.
Definition: TClassRef.h:29
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:75
virtual ~TMemberStreamer()
virtual const TClass * GetOnFileClass() const
TMemberStreamer(MemberStreamerFunc_t pointer)
virtual void operator()(TBuffer &b, void *pmember, Int_t size=0)
TMemberStreamer & operator=(const TMemberStreamer &rhs)
MemberStreamerFunc_t fStreamer
virtual void SetOnFileClass(const TClass *cl)
TClassRef fOnFileClass
TMemberStreamer(const TMemberStreamer &rhs)