Transient Recorder Framework
TRChannelDataSubmit.h
Go to the documentation of this file.
1 /* This file is part of the Transient Recorder Framework.
2  * It is subject to the license terms in the LICENSE.txt file found in the
3  * top-level directory of this distribution and at
4  * https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. No part
5  * of the Transient Recorder Framework, including this file, may be copied,
6  * modified, propagated, or distributed except according to the terms
7  * contained in the LICENSE.txt file.
8  */
9 
16 #ifndef TRANSREC_CHANNEL_DATA_SUBMIT_H
17 #define TRANSREC_CHANNEL_DATA_SUBMIT_H
18 
19 #include <stddef.h>
20 
21 #include <epicsTime.h>
22 
23 #include <NDArray.h>
24 
25 #include "TRNonCopyable.h"
26 
27 class TRBaseDriver;
29 
39  private TRNonCopyable
40 {
41 public:
53  : m_array(NULL)
54  {
55  }
56 
63  {
64  if (m_array != NULL) {
65  m_array->release();
66  }
67  }
68 
85  bool allocateArray (TRBaseDriver &driver, int channel_num, NDDataType_t data_type,
86  int num_samples);
87 
93  inline void releaseArray ()
94  {
95  if (m_array != NULL) {
96  m_array->release();
97  m_array = NULL;
98  }
99  }
100 
114  inline void * data ()
115  {
116  return (m_array == NULL) ? NULL : m_array->pData;
117  }
118 
149  void submit (TRBaseDriver &driver, int channel, int unique_id,
150  double timestamp, epicsTimeStamp epics_ts,
151  TRArrayCompletionCallback *compl_cb);
152 
153 private:
154  // The current NDArray, or NULL if none.
155  NDArray *m_array;
156 };
157 
165 public:
172  virtual bool completeArray (NDArray *array) = 0;
173 };
174 
175 #endif
Callback class for final adjustment of the NDArray.
Definition: TRChannelDataSubmit.h:164
Class for submitting burst data.
Definition: TRChannelDataSubmit.h:38
void releaseArray()
Release any array.
Definition: TRChannelDataSubmit.h:93
Central class of the Transient Recorder framework for transient recorders (digitizers).
Definition: TRBaseDriver.h:55
void submit(TRBaseDriver &driver, int channel, int unique_id, double timestamp, epicsTimeStamp epics_ts, TRArrayCompletionCallback *compl_cb)
Submit the array to AreaDetector.
~TRChannelDataSubmit()
Destructor for the data-submit object.
Definition: TRChannelDataSubmit.h:62
TRChannelDataSubmit()
Constructor for the data-submit object.
Definition: TRChannelDataSubmit.h:52
void * data()
Returns the data pointer of the array.
Definition: TRChannelDataSubmit.h:114
bool allocateArray(TRBaseDriver &driver, int channel_num, NDDataType_t data_type, int num_samples)
Set parameters for the array and allocate the NDArray.