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

//
// $Id: BrDbConditionsKeithley.cxx,v 1.1 2002/04/02 15:11:29 hagel Exp $
// $Author: hagel $
// $Date: 2002/04/02 15:11:29 $
// $Copyright: 2000 Brahms Collaboration 
//

#include <BrDbConditionsKeithley.h>
#ifndef BRAT_BrException
#include "BrException.h"
#endif
#ifndef WIN32 
#include <cstdlib>
#include <iostream>
#else 
#include <stdlib.h>
#include <iostream.h>
#endif

ClassImp(BrDbConditionsKeithley);
 
//____________________________________________________________________
const Char_t* BrDbConditionsKeithley::kTableName = "ConditionsKeithley";

//____________________________________________________________________
 BrDbConditionsKeithley::BrDbConditionsKeithley(void) 
{
  // Empty default constructor.
}

//____________________________________________________________________
 BrDbConditionsKeithley::BrDbConditionsKeithley(Int_t    time,
				       Int_t    unit,
				       Int_t    channel,
				       Float_t  value)
{
  // Constructor.
  fTime    = time;
  fUnit    = unit;
  fChannel = channel;
  fValue   = value;

  SetDBID(time);
}

//____________________________________________________________________
BrDbQuery* 
 BrDbConditionsKeithley::Create(void)
{
  // Returns a SQL query string suitable for creation of this table in
  // a database. 

  cerr << "BrDbConditionsKeithley::Create not implemented for this table"
       << endl;
  return new BrDbQuery();
}

//____________________________________________________________________
BrDbConditionsKeithley*  
 BrDbConditionsKeithley::SingleInstance(TSQLRow* row)
{
  // Returns an instance of a BrDbConditionsKeithley. User needs to store this
  // object imidiatly. 
  BrDbConditionsKeithley* data = 
    new BrDbConditionsKeithley(strtol(row->GetField(0),NULL,0),  // Time
			   strtol(row->GetField(1),NULL,0),  // Unit
			   strtol(row->GetField(2),NULL,0),  // Channel
			   strtod(row->GetField(3),NULL));   // value
  return data;
}

//____________________________________________________________________
TObjArray*    
 BrDbConditionsKeithley::MultipleInstance(TSQLResult* res)
{
  // Returns an (1D) array of BrDbConditionsKeithley's matching Query that made
  // the TSQLResult. User need to store this immediately. 
  if (!res) return 0;
  Int_t count = (res) ? res->GetRowCount() : 0;
  TObjArray* table = new TObjArray(count);

  for (Int_t i = 0; i < count; i++)
    table->Add(BrDbConditionsKeithley::SingleInstance(res->Next()));
  
  return table;
}

//____________________________________________________________________
BrDbQuery* 
 BrDbConditionsKeithley::Insert(void) 
{
  cerr << "BrDbConditionsKeithley::Insert not implemented for this table"
       << endl;
  return new BrDbQuery();
}

//____________________________________________________________________



//
// $Log: BrDbConditionsKeithley.cxx,v $
// Revision 1.1  2002/04/02 15:11:29  hagel
// Initial placeholder revision; changes to use it not committed yet
//
// 

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