00001 // @(#)root/io:$Id: TEmulatedMapProxy.h 36061 2010-10-04 16:05:51Z pcanal $ 00002 // Author: Markus Frank 28/10/04 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 #ifndef ROOT_TEmulatedMapProxy 00012 #define ROOT_TEmulatedMapProxy 00013 00014 ////////////////////////////////////////////////////////////////////////// 00015 // // 00016 // TEmulatedMapProxy 00017 // 00018 // Streamer around an arbitrary STL like container, which implements basic 00019 // container functionality. 00020 // 00021 ////////////////////////////////////////////////////////////////////////// 00022 00023 #include "TEmulatedCollectionProxy.h" 00024 00025 class TEmulatedMapProxy : public TEmulatedCollectionProxy { 00026 00027 protected: 00028 // Map input streamer 00029 void ReadMap(int nElements, TBuffer &b); 00030 00031 // Map output streamer 00032 void WriteMap(int nElements, TBuffer &b); 00033 00034 public: 00035 // Virtual copy constructor 00036 virtual TVirtualCollectionProxy* Generate() const; 00037 00038 // Copy constructor 00039 TEmulatedMapProxy(const TEmulatedMapProxy& copy); 00040 00041 // Initializing constructor 00042 TEmulatedMapProxy(const char* cl_name); 00043 00044 // Standard destructor 00045 virtual ~TEmulatedMapProxy(); 00046 00047 // Return the address of the value at index 'idx' 00048 virtual void *At(UInt_t idx); 00049 00050 // Return the current size of the container 00051 virtual UInt_t Size() const; 00052 00053 // Read portion of the streamer 00054 virtual void ReadBuffer(TBuffer &buff, void *pObj); 00055 virtual void ReadBuffer(TBuffer &buff, void *pObj, const TClass *onfile); 00056 00057 // Streamer for I/O handling 00058 virtual void Streamer(TBuffer &refBuffer); 00059 00060 // Streamer I/O overload 00061 virtual void Streamer(TBuffer &buff, void *pObj, int siz) { 00062 TEmulatedCollectionProxy::Streamer(buff,pObj,siz); 00063 } 00064 }; 00065 00066 #endif