Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-02 08:21:07

0001 #ifndef __RCDAQ_PLUGIN_H__
0002 #define __RCDAQ_PLUGIN_H__
0003 
0004 
0005 //#include <rcdaq.h>
0006 #include <rcdaq_rpc.h>
0007 #include <iostream>
0008 
0009 
0010 class RCDAQPlugin;
0011 class daq_device;
0012 
0013 int add_readoutdevice( daq_device *d);
0014 
0015 void plugin_register(RCDAQPlugin * );
0016 void plugin_unregister(RCDAQPlugin *);
0017 
0018 /** This is the pure virtual parent class for any plugin
0019 
0020 Upon loading, it registers itself with rcdaq
0021 
0022 */
0023 
0024 
0025 class RCDAQPlugin
0026 {
0027 
0028  public:
0029   RCDAQPlugin()
0030     {
0031       plugin_register(this);
0032     }
0033   
0034   virtual ~RCDAQPlugin()
0035     {
0036       plugin_unregister(this);
0037     }
0038 
0039   // this returns
0040   //  0 for all ok
0041   // -1 for "I don't know this device"
0042   //  1 for "I know this device but the parameters are wrong"
0043   virtual int  create_device(deviceblock *db) = 0;
0044 
0045   // this says something about the plugin. The flag is forlibsrs_utils.la future
0046   // use to we can step up the verbosity if needed.
0047   virtual void identify(std::ostream& os = std::cout, const int flag=0) const =0; 
0048 
0049   
0050  protected:
0051   
0052   
0053 };
0054 
0055 
0056 #endif