Jpp  18.0.1-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JServerDB.cc File Reference

Auxiliary program to print host name of data base server. More...

#include <iostream>
#include <iomanip>
#include "dbclient/KM3NeTDBClient.h"
#include "JDB/JDB.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 print host name of data base server.

Author
mdejong

Definition in file JServerDB.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 18 of file JServerDB.cc.

19 {
20  using namespace std;
21  using namespace JPP;
22 
23  JServer server;
24  int debug;
25 
26  try {
27 
28  JParser<> zap("Auxiliary program to print host name of data base server.");
29 
30  zap['s'] = make_field(server) = getServernames();
31  zap['d'] = make_field(debug) = 1;
32 
33  zap(argc, argv);
34  }
35  catch(const exception &error) {
36  FATAL(error.what() << endl);
37  }
38 
39  cout << JDB::getServer().HostName() << endl;
40 }
Utility class to parse command line options.
Definition: JParser.hh:1514
const Server & getServer(const std::string &server)
Get server by name.
Definition: JDB.hh:89
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1989
#define FATAL(A)
Definition: JMessage.hh:67
std::vector< JServer > getServernames()
Get list of names of available database servers.
Definition: JDB.hh:106
int debug
debug level