-
Notifications
You must be signed in to change notification settings - Fork 14
/
rcdaq_plugin.h
56 lines (35 loc) · 987 Bytes
/
rcdaq_plugin.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef __RCDAQ_PLUGIN_H__
#define __RCDAQ_PLUGIN_H__
//#include <rcdaq.h>
#include <rcdaq_rpc.h>
#include <iostream>
class RCDAQPlugin;
class daq_device;
int add_readoutdevice( daq_device *d);
void plugin_register(RCDAQPlugin * );
void plugin_unregister(RCDAQPlugin *);
/** This is the pure virtual parent class for any plugin
Upon loading, it registers itself with rcdaq
*/
class RCDAQPlugin
{
public:
RCDAQPlugin()
{
plugin_register(this);
}
virtual ~RCDAQPlugin()
{
plugin_unregister(this);
}
// this returns
// 0 for all ok
// -1 for "I don't know this device"
// 1 for "I know this device but the parameters are wrong"
virtual int create_device(deviceblock *db) = 0;
// this says something about the plugin. The flag is forlibsrs_utils.la future
// use to we can step up the verbosity if needed.
virtual void identify(std::ostream& os = std::cout, const int flag=0) const =0;
protected:
};
#endif