Jpp 19.3.0-rc.1
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 "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 92 of file JAsciiDB.cc.

93{
94 using namespace std;
95 using namespace JPP;
96
97 typedef JDBTypes_t typelist;
98
99 JServer server;
100 string usr;
101 string pwd;
102 string cookie;
103 string query;
104 JSelector selection;
105 int debug;
106
107 try {
108
109 JParser<> zap("Auxiliary program to convert data from data base into ASCII format.");
110
111 zap['s'] = make_field(server) = getServernames();
112 zap['u'] = make_field(usr) = "";
113 zap['!'] = make_field(pwd) = "";
114 zap['C'] = make_field(cookie) = "";
115 zap['q'] = make_field(query) = getQueries<typelist>();
116 zap['@'] = make_field(selection) = JPARSER::initialised();
117 zap['d'] = make_field(debug) = 1;
118
119 zap['q'] = JPARSER::not_initialised();
120
121 zap(argc, argv);
122 }
123 catch(const exception &error) {
124 FATAL(error.what() << endl);
125 }
126
127
128 try {
129
130 JDB::reset(usr, pwd, cookie);
131
132 JDBToolkit::initialise(getDetector);
133
134 IO io(getType<typelist>());
135
136 io[query]->copy(query, selection);
137 }
138 catch(const exception& error) {
139 FATAL(error.what() << endl);
140 }
141}
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Utility class to parse command line options.
Definition JParser.hh:1698
std::pair< int, std::string > const & getType(CLBCommonHeader const &header)
Definition datatypes.cpp:12
std::vector< JServer > getServernames()
Get list of names of available database servers.
Definition JDB.hh:108
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Wrapper class for server name.
Definition JDB.hh:54
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