BRAT 2.4.5
Class index
Full class index
brahmlib
BRAHMS
ROOT page
//____________________________________________________________________
// 
// 
// 

//____________________________________________________________________
//
// $Id: BrPassInfoManager.cxx,v 1.1 2001/10/08 11:01:07 cholm Exp $
// $Author: cholm $
// $Date: 2001/10/08 11:01:07 $
// $Copyright: (C) 2001 BRAHMS Collaboration <brahmlib@rhic.bnl.gov>
//
#ifndef BRAT_BrPassInfoManager
#include "BrPassInfoManager.h"
#endif
#ifndef __IOSTREAM__
#include <iostream>
#endif
#ifndef __IOMANIP__
#include <iomanip>
#endif
#ifndef ROOT_TObjString
#include "TObjString.h"
#endif

//____________________________________________________________________
ClassImp(BrPassInfoManager);

//____________________________________________________________________
BrPassInfoManager* BrPassInfoManager::fgInstance = 0;

//____________________________________________________________________
 BrPassInfoManager::BrPassInfoManager()
  : fNextPass(&fPasses)
{
  // Default constructor
  fInitialized = kFALSE;
  fDebugLevel  = 0; 
}

//____________________________________________________________________
 BrPassInfoManager* BrPassInfoManager::Instance() 
{
  if (!fgInstance)
    fgInstance = new BrPassInfoManager;
  return fgInstance;
}

//____________________________________________________________________
 void BrPassInfoManager::Init() 
{ 
  if (!fInitialized)
    fNextPass.Reset();
  fInitialized = kTRUE; 
  fCurrentPass.Init();

  if (DebugLevel() > 2) {
    cout << "Requsted passes: " << endl
	 << " Run #  Name" << endl
	 << " -----------------------------------------------" << endl;
    TIter next(&fPasses);
    TObject* s = 0;
    while ((s = next())) 
      cout << " " << setw(6) << s->GetUniqueID() 
	   << " " << s->GetName() << endl;
  }
}

//____________________________________________________________________
 BrPassInfo* BrPassInfoManager::Register(const Char_t* name, 
					Int_t runNo) 
{
  if (fInitialized) {
    Warning("Register", "must be sent before Init");
    return &fCurrentPass;
  }
  TObjString* s = new TObjString(name);
  s->SetUniqueID(runNo);
  fPasses.Add(s);
  
  return &fCurrentPass;
}

//____________________________________________________________________
 void BrPassInfoManager::Update() 
{
  TObject* p = fNextPass();
  if (!p) 
    return; 
  fCurrentPass.Update(p->GetName(), p->GetUniqueID());
}

//____________________________________________________________________
 void BrPassInfoManager::Commit() 
{
  TObject* p = fNextPass();
  if (!p) 
    return; 
  fCurrentPass.Commit(p->GetName(), p->GetUniqueID());
}

//____________________________________________________________________
//
// $Log: BrPassInfoManager.cxx,v $
// Revision 1.1  2001/10/08 11:01:07  cholm
// Reimplmented this DB interface to allow Polymorphic access.  This means
// the at the class BrPassInfo and the corresponding manager
// BrPassInfoManager is what the user sees, rather than the lowlevel
// BrDbPass and so on.  Also, shortend some class names since they were
// really long and didn't really add any information to the class. All
// table representations are now prefixed with BrDb like in other database
// access classes.
//
//

This page automatically generated by script docBrat by Christian Holm

Copyright ; 2002 BRAHMS Collaboration <brahmlib@rcf.rhic.bnl.gov>
Last Update on by

Validate HTML
Validate CSS