Back to index

PHNodeReset.C

 
//----------------------------------------------------------------------------- 
//  $Header: /afs/rhic/phenix/cvsroot/offline/framework/phool/PHNodeReset.C,v 1.3 2001/03/12 14:42:06 pinkenbu Exp $ 
// 
//  The PHOOL's Software 
//  Copyright (C) PHENIX collaboration, 1999 
// 
//  Implementation of class PHNodeReset 
// 
//  Author: Matthias Messer 
//----------------------------------------------------------------------------- 
#include "PHNodeReset.h"  
#include "PHDataNode.h"  
#include "PHIODataNode.h"  
#include "PHTable.hh" 
#include "PHObject.h" 
 
PHNodeReset::PHNodeReset()  
{ 
} 
 
PHNodeReset::~PHNodeReset()  
{ 
} 
 
/*  
here goes the object independance, we need to call different reset functions 
(and do hard casts on the object type, not good if the object is not of the  
type we think it is. 
Currently we have the old wrapped tables (PHTable) - need SetRowCount(0) 
and the new PHObjects - need Reset() 
*/  
void PHNodeReset::perform(PHNode* node) 
{ 
   if (node->getType() == "PHDataNode") 
     {   
       if (node->getObjectType() == "PHTable") 
	 { 
 	  (((PHDataNode<PHTable>*)node)->getData())->SetRowCount(0); 
	 } 
       if (node->getObjectType() == "PHObject") 
	 { 
	  (((PHDataNode<PHObject>*)node)->getData())->Reset(); 
         } 
     } 
   else if (node->getType() == "PHIODataNode") 
     { 
       if (node->getObjectType() == "PHTable") 
	 { 
 	   (((PHIODataNode<PHTable>*)node)->getData())->SetRowCount(0); 
	 } 
       if (node->getObjectType() == "PHObject") 
	 { 
	   (((PHDataNode<PHObject>*)node)->getData())->Reset(); 
	 } 
     } 
} 

Back to index