GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MainGo4AnalysisClient.cxx
Go to the documentation of this file.
1 // $Id: MainGo4AnalysisClient.cxx 932 2013-01-29 13:32:22Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #include <stdlib.h>
15 
16 #include "Riostream.h"
17 #include "TApplication.h"
18 
19 #include "TGo4Log.h"
20 #include "TGo4AnalysisClient.h"
21 
22 void usage()
23 {
24  std::cout << "usage: MainGo4AnalysisClient clientname serverhostname connectorport"<<std::endl;
25 }
26 
27 
28 int main(int argc, char **argv)
29 {
30  TApplication theApp("App", &argc, argv);
31  // define debug output section:
32  TGo4Log::Instance(); // init logger object
33  TGo4Log::SetIgnoreLevel(0); // set this to 1 to suppress detailed debug output
34  // set this to 2 to get warnings and errors only
35  // set this to 3 to get errors only
36  TGo4Log::LogfileEnable(kFALSE); // will enable or disable logging all messages to file
37 
38 
39  if(argc<4)
40  {
41  usage();
42 
43  }
44  else
45  {
46  const char* name=argv[1];
47  const char* hostname=argv[2];
48  const char* connector=argv[3];
49  UInt_t con=atoi(connector);
50  std::cout << "Client:"<<name<<",\tHost:"<<hostname<<",\tConnector:"<<con<<std::endl;
51 
52  // variant 1: use demo with internal plain analysis base class
53  TGo4AnalysisClient* myclient = new TGo4AnalysisClient(name,0,hostname,con);
54 
55  // variant 2: create user analysis and pass it to client, client adopts it
56 // TEbAnalysis* myanalysis= new TEbAnalysis;
57 // myanalysis->SetAutoSaveFile("EbAutoSave");
58 // myanalysis->SetAutoSaveInterval(200000);
59 // TGo4AnalysisClient* myclient = new TGo4AnalysisClient(name,myanalysis,hostname,con);
60 
61 
62  std::cout << "Created AnalysisClient Instance: "<<myclient->GetName()<<std::endl; // dummy action for warnings
63  theApp.Run();
64 
65  return 0;
66 
67  } // if(argc<4)
68 
69 //} // if (rev)
70 
71 }
static TGo4Log * Instance()
Definition: TGo4Log.cxx:87
int main(int argc, char **argv)
static void SetIgnoreLevel(Int_t level)
Definition: TGo4Log.cxx:322
void usage()
const char * GetName() const
static void LogfileEnable(Bool_t on=kTRUE)
Definition: TGo4Log.cxx:369