using namespace std;
#include <iostream>
#include <iomanip>
#include "hrichpadgraph.h"
ClassImp(HRichPadGraph)
HRichPadGraph::HRichPadGraph() {
iNodeListLen = 0;
iNodeNr = 0;
iLinkNodeNr = 0;
iLabel = 0;
pNodeList = NULL;
}
HRichPadGraph::~HRichPadGraph() {
if (pNodeList) {
delete [] pNodeList;
pNodeList = NULL;
}
}
HRichPadGraph::HRichPadGraph(const HRichPadGraph& source) {
iNodeListLen = source.iNodeListLen;
iNodeNr = source.iNodeNr;
iLinkNodeNr = source.iLinkNodeNr;
iLabel = source.iLabel;
if (pNodeList) delete [] pNodeList;
if (source.pNodeList) {
pNodeList = new HRichPadGraph*[iNodeListLen];
for (Int_t i = 0; i < iNodeListLen; i++) pNodeList[i] = source.pNodeList[i];
} else pNodeList = NULL;
}
HRichPadGraph& HRichPadGraph::operator=(const HRichPadGraph& source) {
if (this != &source) {
iNodeNr = source.iNodeNr;
iLinkNodeNr = source.iLinkNodeNr;
iLabel = source.iLabel;
if (source.pNodeList == NULL) {
if (pNodeList) delete [] pNodeList;
pNodeList = NULL;
} else if (iNodeListLen == source.iNodeListLen) {
for (Int_t i = 0; i < iNodeListLen; i++) pNodeList[i] = source.pNodeList[i];
} else if (iNodeListLen == 0) {
pNodeList = new HRichPadGraph*[source.iNodeListLen];
for (Int_t i = 0; i < source.iNodeListLen; i++) pNodeList[i] = source.pNodeList[i];
} else {
delete [] pNodeList;
pNodeList = new HRichPadGraph*[source.iNodeListLen];
for (Int_t i = 0; i < source.iNodeListLen; i++) pNodeList[i] = source.pNodeList[i];
}
iNodeListLen = source.iNodeListLen;
}
return *this;
}
void HRichPadGraph::Streamer(TBuffer &R__b) {
if (R__b.IsReading()) {
Version_t R__v = R__b.ReadVersion(); if (R__v) { }
TObject::Streamer(R__b);
R__b >> iNodeListLen;
R__b >> iNodeNr;
R__b >> iLinkNodeNr;
R__b >> iLabel;
pNodeList = new HRichPadGraph*[iNodeListLen];
R__b.ReadFastArray((Long_t *)pNodeList, iNodeListLen);
} else {
R__b.WriteVersion(HRichPadGraph::IsA());
TObject::Streamer(R__b);
R__b << iNodeListLen;
R__b << iNodeNr;
R__b << iLinkNodeNr;
R__b << iLabel;
R__b.WriteFastArray((const Long_t *)pNodeList, iNodeListLen);
}
}
void HRichPadGraph::InitGraph(Int_t nodenr, Int_t listlen) {
iNodeNr = nodenr;
iNodeListLen = listlen;
iLinkNodeNr = 0;
iLabel = 0;
if (iNodeListLen > 0) pNodeList = new HRichPadGraph*[iNodeListLen];
}
void HRichPadGraph::AddNode(HRichPadGraph* nodeptr) {
pNodeList[iLinkNodeNr++] = nodeptr;
}
Int_t HRichPadGraph::MarkNodes(Int_t labelnr) {
if (iLabel) return 0;
iLabel = labelnr + 1;
for (Int_t i = 0; i < iLinkNodeNr; i++) pNodeList[i]->MarkNodes(labelnr);
return 1;
}
Last change: Sat May 22 13:09:33 2010
Last generated: 2010-05-22 13:09
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.