FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairLinkManager.cxx
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- FairLinkManager source file -----
3 // ----- Created 05/06/14 by T.Stockmanns -----
4 // -------------------------------------------------------------------------
5 
6 #include "FairLinkManager.h"
7 
8 #include "FairLogger.h"
9 #include "FairRun.h"
10 
11 TMCThreadLocal FairLinkManager* FairLinkManager::fgInstance = 0;
12 
14 {
15  // Returns singleton instance.
16  // ---
17  return fgInstance;
18 }
19 
21  : TObject()
22  , fIgnoreTypes()
23  , fIgnoreSetting(kTRUE)
24  , fLogger(0)
25 {
26  if (fgInstance) {
27  Fatal("FairLinkManager", "Singleton instance already exists.");
28  return;
29  }
30  // std::cout << "-I- FairLinkManager::FairLinkManager created!" << std::endl;
31  fgInstance = this;
32 
33  // Logger only on master - TO DO
34  if (FairRun::Instance()->GetIsMaster()) {
35  fLogger = FairLogger::GetLogger();
36  }
37 }
38 
40 {
41  LOG(debug) << "Enter Destructor of FairLinkManager";
42  fgInstance = 0;
43  LOG(debug) << "Leave Destructor of FairLinkManager";
44 }
45 
47 {
48  if (fIgnoreSetting == kFALSE) {
49  LOG(debug) << "AddIgnoreType ignored because of IncludeType setting";
50  return;
51  }
52  LOG(debug) << "AddIgnoreType";
53  fIgnoreTypes.insert(type);
54 }
55 
57 {
58  LOG(debug) << "AddIgnoreType";
59  if (fIgnoreSetting == kTRUE) {
60  fIgnoreSetting = kFALSE;
61  fIgnoreTypes.clear();
62  }
63  fIgnoreTypes.insert(type);
64 }
65 
66 Bool_t FairLinkManager::IsIgnoreType(Int_t type) const
67 {
68  if (fIgnoreSetting)
69  return fIgnoreTypes.count(type);
70  else
71  return !fIgnoreTypes.count(type);
72 }
73 
static FairRun * Instance()
Definition: FairRun.cxx:31
virtual void AddIncludeType(Int_t type)
ClassImp(FairEventBuilder)
static FairLinkManager * Instance()
virtual Bool_t IsIgnoreType(Int_t type) const
virtual void AddIgnoreType(Int_t type)
static FairLogger * GetLogger()
Definition: FairLogger.cxx:39
virtual ~FairLinkManager()