2 /**************************************************************************
3 * This file is property of and copyright by the ALICE HLT Project *
4 * ALICE Experiment at CERN, All rights reserved. *
6 * Primary Authors: Artur Szostak <artursz@iafrica.com> *
7 * for The ALICE HLT Project. *
9 * Permission to use, copy, modify and distribute this software and its *
10 * documentation strictly for non-commercial purposes is hereby granted *
11 * without fee, provided that the above copyright notice appears in all *
12 * copies and that both the copyright notice and this permission notice *
13 * appear in the supporting documentation. The authors make no claims *
14 * about the suitability of this software for any purpose. It is *
15 * provided "as is" without express or implied warranty. *
16 **************************************************************************/
18 /// @file AliHLTGlobalTrigger.cxx
19 /// @author Artur Szostak <artursz@iafrica.com>
21 /// @brief Implementation of the AliHLTGlobalTrigger base class.
23 /// The AliHLTGlobalTrigger base class is an abstract class from which a
24 /// derived class is constructed from AliHLTTriggerMenu on the fly. The derived
25 /// class then implements triggering based on the particular trigger menu.
27 #include "AliHLTGlobalTrigger.h"
28 #include "AliHLTGlobalTriggerWrapper.h"
31 ClassImp(AliHLTGlobalTrigger)
34 AliHLTGlobalTrigger* AliHLTGlobalTrigger::CreateNew(const char* name)
36 // Creates a new instance of the named global trigger class.
38 TClass* c = TClass::GetClass(name);
39 if (c == NULL) return NULL;
40 if (c->GetDeclFileLine() == -1 and c->GetImplFileLine() == -1)
42 // Could not find the implementation lines which should be there if the code
43 // was compiled. So assuming that this is an interpreted class. In this case
44 // we need to use a interface wrapper class to make things work properly.
45 AliHLTGlobalTriggerWrapper* trigger = new AliHLTGlobalTriggerWrapper(name);
46 if (not trigger->IsValid())
55 return static_cast<AliHLTGlobalTrigger*>(c->New());