FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairBaseContFact.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 // -------------------------------------------------------------------------
9 // ----- FairBaseContFact source file -----
10 // ----- Created 25/10/04 by Ilse Koenig -----
11 // -------------------------------------------------------------------------
12 
13 // Factory for the parameter containers in Base
14 
15 #include "FairBaseContFact.h"
16 
17 #include "FairBaseParSet.h"
18 #include "FairGeoParSet.h"
19 #include "FairRuntimeDb.h"
20 
21 #include <TList.h>
22 #include <TString.h>
23 #include <string.h>
24 
25 class FairParSet;
26 
28 
29 static FairBaseContFact gFairBaseContFact;
30 
32  : FairContFact()
33 {
34  // Constructor (called when the library is loaded)
35  fName = "FairBaseContFact";
36  fTitle = "Factory for parameter containers in libSts";
37  setAllContainers();
39 }
40 
41 void FairBaseContFact::setAllContainers()
42 {
45  FairContainer* pTest = new FairContainer("FairBaseParSet", "class for parameter io", "DefaultContext");
46  pTest->addContext("TestNonDefaultContext");
47  containers->Add(pTest);
48 
49  FairContainer* pGeo = new FairContainer("FairGeoParSet", "class for Geo parameter", "DefaultContext");
50  pTest->addContext("TestNonDefaultContext");
51  containers->Add(pGeo);
52 }
53 
55 {
59  const char* name = c->GetName();
60  FairParSet* p = 0;
61  if (strcmp(name, "FairBaseParSet") == 0) {
62  p = new FairBaseParSet(c->getConcatName().Data(), c->GetTitle(), c->getContext());
63  } else if (strcmp(name, "FairGeoParSet") == 0) {
64  p = new FairGeoParSet(c->getConcatName().Data(), c->GetTitle(), c->getContext());
65  }
66 
67  return p;
68 }
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 *)
TString fTitle
Definition: FairParSet.h:22
FairParSet * createContainer(FairContainer *)