FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairParGenericSet.cxx
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 //*-- AUTHOR : Ilse Koenig
9 //*-- Created : 28/01/2009
10 
11 //_HADES_CLASS_DESCRIPTION
13 //
14 // FairParGenericSet
15 //
16 // Base class for all condition-stype parameter containers
17 //
18 // The following functions must be implemented by the derived class:
19 //
20 // void putParams(FairParamList*) Fills all persistent data members into
21 // the list for write.
22 //
23 // Bool_t getParams(FairParamList*) Fills all persistent data members from
24 // the list after reading. The function
25 // returns false, when a data member is
26 // not in the list.
27 //
29 #include "FairParGenericSet.h"
30 
31 #include "FairDetParIo.h" // for FairDetParIo
32 #include "FairParIo.h" // for FairParIo
33 #include "FairParamList.h" // for FairParamList
34 
35 #include <TString.h> // for operator<<, TString
36 #include <iostream> // for operator<<, ostream, cout, etc
37 
39 
41 {
42  // intitializes the container from an input
43  FairDetParIo* input = inp->getDetParIo("FairGenericParIo");
44  if (input) {
45  return (input->init(this));
46  }
47  return kFALSE;
48 }
49 
51 {
52  // writes the container to an output
53  FairDetParIo* out = output->getDetParIo("FairGenericParIo");
54  if (out) {
55  return out->write(this);
56  }
57  return -1;
58 }
59 
61 {
62  // prints information about the container
63  std::cout << "\n---------------------------------------------\n";
64  std::cout << "----- " << GetName() << " -----\n";
65  if (!paramContext.IsNull()) {
66  std::cout << "-- Context/Purpose: " << paramContext << '\n';
67  }
68  if (!author.IsNull()) {
69  std::cout << "-- Author: " << author << '\n';
70  }
71  if (!description.IsNull()) {
72  std::cout << "-- Description: " << description << '\n';
73  }
74  std::cout << "---------------------------------------------\n";
75  FairParamList* condList = new FairParamList;
76  putParams(condList);
77  condList->print();
78  std::cout << "---------------------------------------------\n\n";
79  delete condList;
80 }
virtual const char * GetName() const
Definition: FairParSet.h:38
virtual Int_t write()
Definition: FairParSet.cxx:80
TString author
Definition: FairParSet.h:29
TString description
Definition: FairParSet.h:30
virtual Bool_t init(FairParSet *)
Definition: FairDetParIo.h:32
ClassImp(FairEventBuilder)
virtual Bool_t init()
Definition: FairParSet.cxx:46
TString paramContext
if flag is KTRUE FairDB has the par. class ownership
Definition: FairParSet.h:28
virtual void printParams()
virtual FairDetParIo * getDetParIo(const Text_t *)
Definition: FairParIo.cxx:71
virtual Int_t write(FairParSet *)
Definition: FairDetParIo.h:35
virtual void putParams(FairParamList *)=0