NSCL DDAS  1.0
Support for XIA DDAS at the NSCL
 All Classes Namespaces Files Functions Variables Macros Pages
CrateWriter.h
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 CRATEWRITER_H
22 #define CRATEWRITER_H
23 #include "ModuleSettings.h"
24 namespace DDAS {
25  class SettingsWriter;
31  class CrateWriter {
32  protected:
33  Crate m_settings;
34  public:
35  CrateWriter(const Crate& settings);
36  virtual ~CrateWriter() {}
37  private:
38  CrateWriter(const CrateWriter& );
39  CrateWriter& operator=(const CrateWriter&);
40  int operator==(const CrateWriter&) const;
41  int operator!=(const CrateWriter&) const;
42  public:
43  virtual void write();
44 
45  // Strategy handlers:
46 
47  virtual void startCrate(
48  int id, const std::vector<unsigned short>& slots
49  ) = 0;
50  virtual void endCrate(
51  int id, const std::vector<unsigned short>& slots
52  ) = 0;
53  virtual SettingsWriter* getWriter(unsigned short slotNum) = 0;
54 
55  private:
56  std::vector<unsigned short> makeSlotVector() const;
57 
58  };
59 
60 } // namespace DDAS
61 
62 #endif
Definition: SettingsWriter.h:41
: Capture the settings for a module in a nice struct of a package.
Definition: ModuleSettings.h:106
Definition: CrateWriter.h:31
Definition: functions.h:26