Tools/InclinedShowers/EMComponent/EMComponent.cc
Go to the documentation of this file.
1 
9 #include "EMComponent.h"
10 
11 #include <tls/EMComponent.h>
12 #include "SimpleEMComponent.h"
13 #include "EMComponentIVR.h"
14 #include "ZeroEMComponent.h"
15 
16 #include <utl/Branch.h>
17 #include <utl/AugerException.h>
18 
19 #include <string>
20 
21 using namespace tls;
22 using namespace utl;
23 using namespace std;
24 
26 {
27  string modelo =
28  branch.GetName();
29  if (modelo == "SimpleEMComponent")
30  fEMComponent.reset(new SimpleEMComponent(branch));
31  else if(modelo == "EMComponentIVR")
32  fEMComponent.reset(new EMComponentIVR(branch));
33  else if(modelo == "ZeroEMComponent")
34  fEMComponent.reset(new ZeroEMComponent(branch));
35  else {
36  ostringstream msg;
37  msg << "unknown EMComponent class: " << modelo;
38  throw InvalidConfigurationException(msg.str());
39  }
40 }
41 
42 // Configure (x)emacs for this file ...
43 // Local Variables:
44 // mode:c++
45 // compile-command: "make -C .. -k"
46 // End:
Implementation of EM component interface.
Base class for exceptions arising because configuration data are not valid.
Class representing a document branch.
Definition: Branch.h:107
Simple implementation of EM component interface.
std::string GetName() const
function to get the Branch name
Definition: Branch.cc:374
Implementation of EM component interface.

, generated on Tue Sep 26 2023.