[Bio] / MExplorer / lsCatDb.pcc Repository:
ViewVC logotype

View of /MExplorer/lsCatDb.pcc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (annotate)
Mon Jan 6 23:32:23 2003 UTC (16 years, 9 months ago) by efrank
Branch: MAIN
CVS Tags: V00-00-00, ldrd-2003-01, HEAD

xduGen.cc:
	modify to take an arg (mandatory) that says what process node to start with when dumping

lsCatDb.pcc
	guts of lsCat.  lists the reco catalog.  separated from lsCat itself to simplify
	the makefile.

xduViz
	script to call xduGen followed by invocation of xdu.  takes xdu from ~efrank
	since it is not installed. all hardwired.  gasp.

lsCatdb.pcc
	removed in favor of lsCatDb.pcc so that filename matches function name.

//***********************************************************************
//
// Description:
//
//    Application to list the contents of the reconstruction catalog.
//
// Author List:
//    Ed Frank, efrank@mcs.anl.gov
//
// History:
//    20 Dec 02  efrank          First Version
// 
// 
// Bugs:
//
//***********************************************************************

#include <iostream>
#include <iomanip>

#include "RecoReadoutOracle/OracleMgr.hh"

EXEC SQL BEGIN DECLARE SECTION;

struct s_recoListing {
  VARCHAR    recoName[100][128];   /* Name of the reco in the catalog */
  int        procId[100];	   /* Id of Top node in reco tree */
} recoListing;

EXEC SQL END DECLARE SECTION;
EXEC SQL INCLUDE SQLCA;

//************************************************************************
static void
oracle_error(char* msg ) {
//************************************************************************
  EXEC SQL WHENEVER SQLERROR CONTINUE;
  cout << "OracleMgr: " << OracleMgr::mgr().errMsg() << endl;
  cout << sqlca.sqlerrm.sqlerrmc << endl;
  EXEC SQL ROLLBACK RELEASE;
  exit(1);	
}

//************************************************************************
void
lsCatDb( void ) {
//************************************************************************

  
  OracleMgr::mgr().wantRead("lsCatDb" );

  cout << std::setiosflags(std::ios::left);

  cout << endl
       << std::setw(13) <<  "TopNodeId" 
       << std::setw(67) <<  "Reco Name" 
       << endl;

  cout << std::setw(80) <<  std::setfill('-') << ""
       << std::setfill(' ')
       << endl;

  EXEC SQL DECLARE recolisting_cursor CURSOR FOR
    SELECT RecoName, ProcessId FROM RecoCatalogEntry C, ProcessInReco P
    WHERE c.recoid=p.recoid;

  EXEC SQL WHENEVER SQLERROR DO oracle_error("Ignored text?");
  EXEC SQL OPEN recolisting_cursor;
  EXEC SQL WHENEVER NOT FOUND do break;

  int totalRead = 0;
  int nThisRead = 0;
  for (;;)	{
    EXEC SQL FETCH recolisting_cursor INTO :recoListing;
    nThisRead = sqlca.sqlerrd[2] - totalRead;  //totalRead is _last_ time
    for( int i=0; i<nThisRead; i++) {
      recoListing.recoName[i].arr[ recoListing.recoName[i].len ]='\0';
      cout <<  std::setw(13) <<  recoListing.procId[i]
       <<  std::setw(67) <<  recoListing.recoName[i].arr
       << endl;
    }
    totalRead = sqlca.sqlerrd[2];
  }
  
  // It's possible that we broke out of the last loop on a partial
  // read which was not processed.
  nThisRead = sqlca.sqlerrd[2] - totalRead;
  totalRead = sqlca.sqlerrd[2];
  for( int i=0; i<nThisRead; i++) {
      recoListing.recoName[i].arr[ recoListing.recoName[i].len ]='\0';
      cout <<  std::setw(13) <<  recoListing.procId[i]
       <<  std::setw(67) <<  recoListing.recoName[i].arr
       << endl;
  }
  
  EXEC SQL CLOSE recolisting_cursor;
  OracleMgr::mgr().doneRead();

  return;
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3