testdriver.h
1 /***************************************************************************
2  Copyright (C) 2002-2015 Kentaro Kitagawa
3  kitagawa@phys.s.u-tokyo.ac.jp
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  You should have received a copy of the GNU Library General
11  Public License and a list of authors along with this program;
12  see the files COPYING and AUTHORS.
13 ***************************************************************************/
14 //---------------------------------------------------------------------------
15 
16 #ifndef testdriverH
17 #define testdriverH
18 //---------------------------------------------------------------------------
19 #include "primarydriverwiththread.h"
20 #include "dummydriver.h"
21 
22 class XScalarEntry;
23 
24 class XTestDriver : public XDummyDriver<XPrimaryDriverWithThread> {
25 public:
26  XTestDriver(const char *name, bool runtime,
27  Transaction &tr_meas, const shared_ptr<XMeasure> &meas);
28  //! usually nothing to do
29  virtual ~XTestDriver() {}
30  //! show all forms belonging to driver
31  virtual void showForms();
32 
33  struct Payload : public XPrimaryDriver::Payload {
34  double x() const {return m_x;}
35  double y() const {return m_y;}
36  private:
37  friend class XTestDriver;
38  double m_x,m_y;
39  };
40 protected:
41  //! This function will be called when raw data are written.
42  //! Implement this function to convert the raw data to the record (Payload).
43  //! \sa analyze()
44  virtual void analyzeRaw(RawDataReader &reader, Transaction &tr) throw (XRecordError&);
45  //! This function is called after committing XPrimaryDriver::analyzeRaw() or XSecondaryDriver::analyze().
46  //! This might be called even if the record is invalid (time() == false).
47  virtual void visualize(const Snapshot &shot);
48 private:
49  const shared_ptr<XScalarEntry> m_entryX, m_entryY;
50  void *execute(const atomic<bool> &);
51 
52 };
53 
54 //---------------------------------------------------------------------------
55 #endif

Generated for KAME4 by  doxygen 1.8.3