DABC (Data Acquisition Backbone Core)  2.9.9
Factory.cxx
Go to the documentation of this file.
1 
2 /************************************************************
3  * The Data Acquisition Backbone Core (DABC) *
4  ************************************************************
5  * Copyright (C) 2009 - *
6  * GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
7  * Planckstr. 1, 64291 Darmstadt, Germany *
8  * Contact: http://dabc.gsi.de *
9  ************************************************************
10  * This software can be used under the GPL license *
11  * agreements as stated in LICENSE.txt file *
12  * which is part of the distribution. *
13  ************************************************************/
14 
15 #include "saftdabc/Factory.h"
16 
17 #include <cstdlib>
18 
19 #include "dabc/Command.h"
20 #include "dabc/logging.h"
21 #include "dabc/Url.h"
22 #include "dabc/Manager.h"
23 
24 #include "saftdabc/Definitions.h"
25 #include "saftdabc/Input.h"
26 //#include "saftdabc/Monitor.h"
27 
29 const char* saftdabc::xmlDeviceName = "SaftBoard";
30 
32 const char* saftdabc::xmlInputs = "SaftHardwareInputNames";
33 
35 const char* saftdabc::xmlMasks = "SaftSnoopEventMasks";
36 
37 
39 const char* saftdabc::xmlEventIds = "SaftSnoopEventIds";
40 
41 const char* saftdabc::xmlOffsets = "SaftSnoopOffsets";
42 
43 
45 const char* saftdabc::xmlAcceptFlags = "SaftSnoopFlags";
46 
47 
48 const char* saftdabc::xmlSaftVerbose = "SaftVerbose";
49 
50 
51 
52 
53 const char* saftdabc::xmlSaftSubeventId = "SaftSubeventId";
54 
55 const char* saftdabc::xmlSaftSingleEvent ="SaftSingleEvents";
56 
57 const char* saftdabc::xmlEventFormat ="SaftEventFormat";
58 
59 
60 const char* saftdabc::xmlCallbackMode = "SaftTransportCallback";
61 
62 const char* saftdabc::xmlTimeout = "SaftTimeout";
63 
64 const char* saftdabc::commandRunMainloop = "RunGlibMainloop";
65 
66 const char* saftdabc::parEventRate= "ReceiveEventRate";
67 
69 
70 
71 saftdabc::Factory::Factory(const std::string &name) :
72  dabc::Factory(name)
73 {
74 }
75 
76 
77 dabc::Device* saftdabc::Factory::CreateDevice (const std::string &classname, const std::string &devname,
78  dabc::Command cmd)
79 {
80  DOUT0 ("saftdabc::Factory::CreateDevice called for class:%s, device:%s", classname.c_str (), devname.c_str ());
81 
82  if (strcmp (classname.c_str (), "saftdabc::Device") != 0)
83  return 0;
84  dabc::Device* dev = new saftdabc::Device (devname, cmd);
85  return dev;
86 }
87 
88 
89 
90 
Represents command with its arguments.
Definition: Command.h:99
Base class for device implementation.
Definition: Device.h:43
Small helper class to correctly instantiate user-specific factories.
Definition: Factory.h:106
Factory for saftlib plugin classes
Definition: Factory.h:29
Factory(const std::string &name)
Definition: Factory.cxx:71
dabc::Device * CreateDevice(const std::string &classname, const std::string &devname, dabc::Command cmd)
Factory method to create device.
Definition: Factory.cxx:77
#define DOUT0(args ...)
Definition: logging.h:156
Event manipulation API.
Definition: api.h:23
const char * parEventRate
Name of event rate parameter.
Definition: Factory.cxx:66
const char * xmlCallbackMode
switch between polling for data or callback mode
Definition: Factory.cxx:60
const char * xmlOffsets
WR event offsets to snoop.
Definition: Factory.cxx:41
const char * xmlSaftVerbose
switch between silent or verbose event receiver mode
Definition: Factory.cxx:48
const char * xmlInputs
EXPLODER input name items that should be latched with timestamp.
Definition: Factory.cxx:32
const char * xmlAcceptFlags
WR event accept flags to snoop.
Definition: Factory.cxx:45
const char * xmlEventIds
WR event ids to snoop.
Definition: Factory.cxx:39
const char * xmlTimeout
time out for polling mode
Definition: Factory.cxx:62
const char * xmlSaftSubeventId
Definition: Factory.cxx:53
const char * xmlDeviceName
name of the saft device, e.g.
Definition: Factory.cxx:29
const char * xmlMasks
WR event masks to snoop.
Definition: Factory.cxx:35
const char * xmlSaftSingleEvent
Definition: Factory.cxx:55
const char * xmlEventFormat
Definition: Factory.cxx:57
const char * commandRunMainloop
Command to invoke the glib/dbus mainloop.
Definition: Factory.cxx:64
dabc::FactoryPlugin saftfactory(new saftdabc::Factory("saftdabc"))