DABC (Data Acquisition Backbone Core)  2.9.9
Factory.cxx
Go to the documentation of this file.
1 // $Id: Factory.cxx 4788 2021-07-15 09:06:47Z linev $
2 
3 /************************************************************
4  * The Data Acquisition Backbone Core (DABC) *
5  ************************************************************
6  * Copyright (C) 2009 - *
7  * GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
8  * Planckstr. 1, 64291 Darmstadt, Germany *
9  * Contact: http://dabc.gsi.de *
10  ************************************************************
11  * This software can be used under the GPL license *
12  * agreements as stated in LICENSE.txt file *
13  * which is part of the distribution. *
14  ************************************************************/
15 
16 #include "fesa/Factory.h"
17 
18 #include "fesa/Player.h"
19 #include "fesa/Monitor.h"
20 
22 
23 
24 dabc::Module* fesa::Factory::CreateModule(const std::string &classname, const std::string &modulename, dabc::Command cmd)
25 {
26  if (classname == "fesa::Player")
27  return new fesa::Player(modulename, cmd);
28 
29  if (classname == "fesa::Monitor")
30  return new fesa::Monitor(modulename, cmd);
31 
32  return dabc::Factory::CreateModule(classname, modulename, cmd);
33 }
Represents command with its arguments.
Definition: Command.h:99
Small helper class to correctly instantiate user-specific factories.
Definition: Factory.h:106
virtual Module * CreateModule(const std::string &classname, const std::string &modulename, Command cmd)
Factory method to create module.
Definition: Factory.h:67
Base for dabc::ModuleSync and dabc::ModuleAsync classes.
Definition: Module.h:42
Factory of MBS classes
Definition: Factory.h:29
virtual dabc::Module * CreateModule(const std::string &classname, const std::string &modulename, dabc::Command cmd)
Factory method to create module.
Definition: Factory.cxx:24
Monitor for of FESA data.
Definition: Monitor.h:38
Player of FESA data.
Definition: Player.h:41
dabc::FactoryPlugin fesafactory(new fesa::Factory("fesa"))