allocate_seq_no.cxx
Go to the documentation of this file.00001 #include <TSK_DBI_Log.hxx>
00002 #include "TSeqNoAllocator.hxx"
00003 #include "Rtypes.h"
00004
00005 #include <cstdlib>
00006 #include <iostream>
00007 #include <string>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 int main(int argc, char **argv) {
00028
00029 if ( argc < 2 ) {
00030 SK_DBI_Error("ERROR: Insufficient arguments passed to allocate_seq_no.exe.");
00031 std::cout << "0" << std::endl;
00032 return 1;
00033 }
00034 std::string table_name(argv[1]);
00035 Int_t requireGlobal = 0;
00036 Int_t dbNo = 0;
00037 if ( argc > 2 ) requireGlobal = atoi(argv[2]);
00038 if ( argc > 3 ) dbNo = atoi(argv[3]);
00039 TSeqNoAllocator sna = TSeqNoAllocator();
00040 Int_t seqno = sna.GetSeqNo(table_name,requireGlobal,dbNo);
00041 std::cout << seqno << std::endl;
00042 return 0;
00043 }