TChainElement.cxx

Go to the documentation of this file.
00001 // @(#)root/tree:$Id: TChainElement.cxx 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Rene Brun   11/02/97
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, 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 
00012 //////////////////////////////////////////////////////////////////////////
00013 //                                                                      //
00014 // A TChainElement describes a component of a TChain.                   //
00015 //                                                                      //
00016 //////////////////////////////////////////////////////////////////////////
00017 
00018 #include "TTree.h"
00019 #include "TChainElement.h"
00020 
00021 ClassImp(TChainElement)
00022 
00023 //______________________________________________________________________________
00024 TChainElement::TChainElement() : TNamed(),fBaddress(0),fBaddressType(0),
00025                                  fBaddressIsPtr(kFALSE), fBranchPtr(0)
00026 {
00027    // Default constructor for a chain element.
00028 
00029    fNPackets   = 0;
00030    fPackets    = 0;
00031    fEntries    = 0;
00032    fPacketSize = 100;
00033    fStatus     = -1;
00034    ResetBit(kHasBeenLookedUp);
00035 }
00036 
00037 //______________________________________________________________________________
00038 TChainElement::TChainElement(const char *name, const char *title)
00039    :TNamed(name,title),fBaddress(0),fBaddressType(0),
00040     fBaddressIsPtr(kFALSE), fBranchPtr(0)
00041 {
00042    // Create a chain element.
00043 
00044    fNPackets   = 0;
00045    fPackets    = 0;
00046    fEntries    = 0;
00047    fPacketSize = 100;
00048    fStatus     = -1;
00049    ResetBit(kHasBeenLookedUp);
00050 }
00051 
00052 //______________________________________________________________________________
00053 TChainElement::~TChainElement()
00054 {
00055    // Default destructor for a chain element.
00056 
00057    delete [] fPackets;
00058 }
00059 
00060 //_______________________________________________________________________
00061 void TChainElement::CreatePackets()
00062 {
00063    // Initialize the packet descriptor string.
00064 
00065    fNPackets = 1 + Int_t(fEntries/fPacketSize);
00066    delete [] fPackets;
00067    fPackets = new char[fNPackets+1];
00068    for (Int_t i=0;i<fNPackets;i++) fPackets[i] = ' ';
00069    fPackets[fNPackets] = 0;
00070 
00071 }
00072 
00073 //_______________________________________________________________________
00074 void TChainElement::ls(Option_t *) const
00075 {
00076    // List files in the chain.
00077 
00078    printf("%s tree:%s entries=%lld\n",GetTitle(),GetName(),fEntries);
00079 }
00080 
00081 //_______________________________________________________________________
00082 void TChainElement::SetPacketSize(Int_t size)
00083 {
00084    // Set number of entries per packet for parallel root.
00085 
00086    fPacketSize = size;
00087 }
00088 
00089 //_______________________________________________________________________
00090 void TChainElement::SetLookedUp(Bool_t y)
00091 {
00092    // Set/Reset the looked-up bit
00093    if (y)
00094       SetBit(kHasBeenLookedUp);
00095    else
00096       ResetBit(kHasBeenLookedUp);
00097 }
00098 

Generated on Tue Jul 5 15:33:41 2011 for ROOT_528-00b_version by  doxygen 1.5.1