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 "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
27protected:
29
30public:
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
49private:
52};
53
54#endif
#define b(i)
Definition: RSha256.hxx:100
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Definition: RtypesCore.h:45
void(* MemberStreamerFunc_t)(TBuffer &, void *, Int_t)
Definition: Rtypes.h:74
Buffer base class used for serializing objects.
Definition: TBuffer.h:43
TClassRef is used to implement a permanent reference to a TClass object.
Definition: TClassRef.h:28
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
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)