FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairTutPropContFact.cxx
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2019 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 #include "FairTutPropContFact.h"
9 
10 #include "FairRuntimeDb.h" // for FairRuntimeDb
11 #include "FairTutPropGeoPar.h" // for FairTutPropGeoPar
12 #include "TList.h" // for TList
13 #include "TString.h" // for TString
14 
15 #include <string.h> // for strcmp, NULL
16 
17 class FairParSet;
18 
19 static FairTutPropContFact gFairTutPropContFact;
20 
22  : FairContFact()
23 {
25  fName = "FairTutPropContFact";
26  fTitle = "Factory for parameter containers in libFairTutProp";
27  setAllContainers();
29 }
30 
31 void FairTutPropContFact::setAllContainers()
32 {
38  FairContainer* p = new FairContainer("FairTutPropGeoPar", "FairTutProp Geometry Parameters", "TestDefaultContext");
39  p->addContext("TestNonDefaultContext");
40 
41  containers->Add(p);
42 }
43 
45 {
51  const char* name = c->GetName();
52  if (strcmp(name, "FairTutPropGeoPar") == 0) {
53  return new FairTutPropGeoPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
54  }
55 
56  return nullptr;
57 }
58 
TString fName
Definition: FairParSet.h:21
static FairRuntimeDb * instance(void)
ClassImp(FairEventBuilder)
TList * containers
Definition: FairContFact.h:62
const char * getContext()
TString getConcatName()
void addContFactory(FairContFact *)
void addContext(const char *)
FairParSet * createContainer(FairContainer *)
TString fTitle
Definition: FairParSet.h:22