DABC (Data Acquisition Backbone Core)  2.9.9
Factory.cxx
Go to the documentation of this file.
1 // $Id: Factory.cxx 3862 2018-05-11 10:06:18Z linev $
2 
3 /********************************************************************
4  * The Data Acquisition Backbone Core (DABC)
5  ********************************************************************
6  * Copyright (C) 2009-
7  * GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
8  * Planckstr. 1
9  * 64291 Darmstadt
10  * Germany
11  * Contact: http://dabc.gsi.de
12  ********************************************************************
13  * This software can be used under the GPL license agreements as stated
14  * in LICENSE.txt file which is part of the distribution.
15  ********************************************************************/
16 
17 #include "root/Factory.h"
18 
19 #include "dabc/string.h"
20 #include "dabc/logging.h"
21 #include "dabc/Url.h"
22 
23 #include "root/Monitor.h"
24 #include "root/TreeStore.h"
25 
27 
29 {
30 }
31 
32 dabc::Reference root::Factory::CreateObject(const std::string &classname, const std::string &objname, dabc::Command cmd)
33 {
34  if (classname=="root::Monitor")
35  return new root::Monitor(objname, cmd);
36 
37  if (classname=="root::TreeStore")
38  return new root::TreeStore(objname);
39 
40  return dabc::Factory::CreateObject(classname, objname, cmd);
41 }
42 
43 
44 dabc::DataInput* root::Factory::CreateDataInput(const std::string &typ)
45 {
46  return 0;
47 }
48 
49 
51 {
52  dabc::Url url(typ);
53 
54  if (url.GetProtocol() == "root") {
55  return 0;
56  }
57 
58  return 0;
59 }
Represents command with its arguments.
Definition: Command.h:99
Interface for implementing any kind of data input.
Definition: DataIO.h:61
Interface for implementing any kind of data output.
Definition: DataIO.h:158
Small helper class to correctly instantiate user-specific factories.
Definition: Factory.h:106
virtual Reference CreateObject(const std::string &classname, const std::string &objname, Command cmd)
Factory method to create object.
Definition: Factory.h:58
Reference on the arbitrary object
Definition: Reference.h:73
Uniform Resource Locator interpreter.
Definition: Url.h:33
virtual dabc::DataOutput * CreateDataOutput(const std::string &)
Factory method to create data output.
Definition: Factory.cxx:50
virtual dabc::DataInput * CreateDataInput(const std::string &)
Factory method to create data input.
Definition: Factory.cxx:44
virtual dabc::Reference CreateObject(const std::string &classname, const std::string &objname, dabc::Command cmd)
Factory method to create object.
Definition: Factory.cxx:32
virtual void Initialize()
Method called by the manager during application start.
Definition: Factory.cxx:28
dabc::FactoryPlugin root_factory(new root::Factory("root"))