PdbIndex.cc
//-----------------------------------------------------------------------------
// $header$
//
// The pdbcal package
// Copyright (C) PHENIX collaboration, 1999
//
// Implementation of class PdbIndex
//
// Author: federica
//-----------------------------------------------------------------------------
#include "PdbIndex.hh"
#include "PHString.h"
#include <iostream.h>
PdbIndex::PdbIndex()
{
theMinimum = 0;
theMaximum = 0;
theValue = 0;
strcpy(theName,"UNKNOWN");
}
PdbIndex::PdbIndex(int mini, int maxi)
{
theMinimum = mini;
theMaximum = maxi;
theValue = mini;
strcpy(theName,"UNKNOWN");
}
PdbIndex::PdbIndex(int mini, int maxi, char name[])
{
theMinimum = mini;
theMaximum = maxi;
theValue = mini;
strcpy(theName, name);
}
PdbIndex::PdbIndex(int mini, int maxi, int val, char* name)
{
theMinimum = mini;
theMaximum = maxi;
theValue = val;
strcpy(theName, name);
}
PdbIndex::~PdbIndex()
{
}
PdbIndex::PdbIndex(const PdbIndex &rhs)
{
theMinimum = rhs.theMinimum;
theMaximum = rhs.theMaximum;
theValue = rhs.theValue;
strcpy(theName,rhs.theName);
}
PdbIndex & PdbIndex::operator = (const PdbIndex &rhs)
{
theMinimum = rhs.theMinimum;
theMaximum = rhs.theMaximum;
theValue = rhs.theValue;
strcpy(theName,rhs.theName);
return *this;
}
void PdbIndex::print() const
{
cout << " PdbIndex Description: " << "\n" <<
"\t Name :" << theName << "\n" <<
"\t Minimus set :" << theMinimum << "\n" <<
"\t Maximum set :" << theMaximum << "\n" <<
"\t Present Value :" << theValue << endl;
}
void PdbIndex::setName(char name[])
{
strcpy(theName, name);
}
PHBoolean PdbIndex::setValue(int val)
{
if ((val <= theMaximum) && (val >=theMinimum)) {
theValue = val;
return True;
}else {
theValue = val;
// PHMessage("PdbIndex::setValue",PHError, "Out of range !!! " );
return False;
}
}