Jpp master_rocky-44-g75b7c4f75
the software that should make you happy
Loading...
Searching...
No Matches
JAsciiDB.cc File Reference

Auxiliary program to convert data from data base into ASCII format. More...

#include <iostream>
#include <iomanip>
#include "dbclient/KM3NeTDBClient.h"
#include "JDB/JDB.hh"
#include "JDB/JDBToolkit.hh"
#include "JDB/JSelector.hh"
#include "JDB/JSupport.hh"
#include "JDB/JDBincludes.hh"
#include "JDB/JDBDictionary.hh"
#include "JDB/JDatabaseObjectIterator.hh"
#include "JROOT/JRootStreamObjectOutput.hh"
#include "JROOT/JRootDictionary.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Auxiliary program to convert data from data base into ASCII format.

Author
mdejong

Definition in file JAsciiDB.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 26 of file JAsciiDB.cc.

27{
28 using namespace std;
29 using namespace JPP;
30
31 typedef JDBTypes_t typelist;
32
33 JServer server;
34 string usr;
35 string pwd;
36 string cookie;
37 string query;
38 JSelector selection;
39 int debug;
40
41 try {
42
43 JParser<> zap("Auxiliary program to convert data from data base into ASCII format.");
44
45 zap['s'] = make_field(server) = getServernames();
46 zap['u'] = make_field(usr) = "";
47 zap['!'] = make_field(pwd) = "";
48 zap['C'] = make_field(cookie) = "";
49 zap['q'] = make_field(query) = getQueries<typelist>();
50 zap['@'] = make_field(selection) = JPARSER::initialised();
51 zap['d'] = make_field(debug) = 1;
52
53 zap['q'] = JPARSER::not_initialised();
54
55 zap(argc, argv);
56 }
57 catch(const exception &error) {
58 FATAL(error.what() << endl);
59 }
60
61
62 JRootWriter writer(cout, JEquationParameters(), JDBDictionary::getInstance());
63
64 JRootStreamObjectOutput<typelist> out(writer, "\n");
65
66 try {
67
68 JDB::reset(usr, pwd, cookie);
69
70 JDBToolkit::initialise(getDetector);
71
72 JDatabaseObjectIterator<typelist> in(query, selection);
73
74 in >> out;
75 }
76 catch(const exception& error) {
77 FATAL(error.what() << endl);
78 }
79}
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:69
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Object iteration from database.
Simple data structure to support I/O of equations (see class JLANG::JEquation).
Utility class to parse command line options.
Definition JParser.hh:1698
Template implementation of stream output for single data type based on ROOT dictionary.
Implementation for ASCII output of objects with ROOT dictionary.
std::vector< JServer > getServernames()
Get list of names of available database servers.
Definition JDB.hh:107
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Wrapper class for server name.
Definition JDB.hh:53
Type list.
Definition JTypeList.hh:23
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition JParser.hh:68
Empty structure for specification of parser element that is not initialised (i.e. does require input)...
Definition JParser.hh:74