FRIBParallelanalysis  1.0
FrameworkforMPIParalleldataanalysisatFRIB
MPIRawReader.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  FRIB
14  Michigan State University
15  East Lansing, MI 48824-1321
16 */
17 
21 #ifndef MPIRAWREADER_H
22 #define MPIRAWREADER_H
23 
24 #include <stddef.h>
25 
26 
27 namespace frib {
28  namespace analysis {
29  class CDataReader;
30  class AbstractApplication;
52  class CMPIRawReader {
53  private:
54  int m_argc;
55  char** m_argv;
56  AbstractApplication* m_pApp;
57  CDataReader* m_pReader;
58  unsigned m_nBlockSize;
59  unsigned m_nEndsLeft;
60  public:
61  CMPIRawReader(int argc, char** argv, AbstractApplication* pApp);
62  virtual ~CMPIRawReader();
63  private:
64  CMPIRawReader(const CMPIRawReader& rhs);
65  CMPIRawReader& operator=(const CMPIRawReader& rhs);
66  int operator==(const CMPIRawReader& rhs);
67  int operator!=(const CMPIRawReader& rhs);
68  public:
69  void operator()();
70  private:
71  // These utilities are virtual so that the user can override them
72  // to parse argc/argv differently than we do.
73  //
74  virtual const char* getInputFile(int argc, char** argv) const;
75  virtual unsigned getBlockSize(int argc, char** argv) const;
76 
77  void sendData();
78 
79  unsigned countTriggers(const void* pData, size_t numItems) const;
80  void sendWorkItem(const void* pData, size_t nBytes, unsigned blockNum);
81  int getRequest();
82  };
83  }
84 }
85 
86 
87 
88 #endif
89 
Definition: AbstractApplication.h:102
Definition: DataReader.h:60
void operator()()
Definition: MPIRawReader.cpp:64
virtual ~CMPIRawReader()
Definition: MPIRawReader.cpp:53
Definition: MPIRawReader.h:52
CMPIRawReader(int argc, char **argv, AbstractApplication *pApp)
Definition: MPIRawReader.cpp:39
Definition: AbstractApplication.cpp:30