NSCL DDAS  1.0
Support for XIA DDAS at the NSCL
 All Classes Namespaces Files Functions Variables Macros Pages
CrateReader.h
Go to the documentation of this file.
1 /*
2  This software is Copyright by the Board of Trustees of Michigan
3  State University (c) Copyright 2017.
4 
5  You may use this software under the terms of the GNU public license
6  (GPL). The terms of this license are described at:
7 
8  http://www.gnu.org/licenses/gpl.txt
9 
10  Authors:
11  Ron Fox
12  Giordano Cerriza
13  NSCL
14  Michigan State University
15  East Lansing, MI 48824-1321
16 */
17 
21 #ifndef CRATE_READER_H
22 #define CRATE_READER_H
23 #include "ModuleSettings.h"
24 #include <vector>
25 
26 
27 namespace DDAS {
28  class SettingsReader;
29 
40  class CrateReader {
41  protected:
42  std::vector<unsigned short> m_slots;
43  unsigned m_crateId;
44  public:
45  CrateReader() {}
46  CrateReader(unsigned crate, const std::vector<unsigned short>& slots);
47  virtual ~CrateReader();
48  private:
49  CrateReader(const CrateReader&);
50  CrateReader& operator=(const CrateReader& );
51  int operator==(const CrateReader&) const;
52  int operator!=(const CrateReader&) const;
53  public:
54  // These methods form a strategy pattern which can
55  // be completely overidden if needed.
56 
57  virtual Crate readCrate();
58  virtual SettingsReader* createReader(unsigned short slot) = 0;
59  };
60 
61 
62 } // End namespace DDAS
63 
64 #endif
: Capture the settings for a module in a nice struct of a package.
virtual Crate readCrate()
Definition: CrateReader.cpp:52
Definition: SettingsReader.h:38
Definition: CrateReader.h:40
Definition: ModuleSettings.h:106
Definition: functions.h:26
virtual ~CrateReader()
Definition: CrateReader.cpp:39