NSCL DDAS  1.0
Support for XIA DDAS at the NSCL
 All Classes Namespaces Files Functions Variables Macros Pages
DSPFileReader.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  Jeromy Tompkins
13  NSCL
14  Michigan State University
15  East Lansing, MI 48824-1321
16 */
17 
22 #ifndef DSPFILEREADER_H
23 #define DSPFILEREADER_H
24 
25 #include <pixie16app_defs.h> // N_DSP_PAR defined there.
26 #include <vector>
27 #include <cstdint>
28 #include <string>
29 #include <sys/types.h> // For off_t (I think).
30 
32 {
33 private:
34  typedef std::uint32_t ModuleParams[N_DSP_PAR]; // Params for a module.
35  std::vector<std::uint32_t*> m_moduleParameters;
36 
37 public:
38  void readSetFile(std::string filename);
39  size_t getModuleCount() const;
40  const void* getModuleParameters(size_t which);
41 
42 private:
43  int openFile(std::string name);
44  void readBlock(int fd, void* pBuffer, size_t nBytes);
45  off_t getFileLength(int fd);
46  void emptyVector();
47 };
48 
49 #endif
Definition: DSPFileReader.h:31