~christopher-hunt08/maus/beam_selection_development

« back to all changes in this revision

Viewing changes to src/common_cpp/Converter/DataConverters/CppJsonSpillConverter.hh

  • Committer: Chris Rogers
  • Date: 2012-10-13 18:43:00 UTC
  • mfrom: (663.6.137 merge)
  • mto: (663.6.204 merge)
  • mto: This revision was merged to the branch mainline in revision 680.
  • Revision ID: chris.rogers@stfc.ac.uk-20121013184300-ry9q81m45dmtgejr
Bring control room branch into line with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 *
16
16
 */
17
17
 
18
 
#ifndef CPPJSONCONVERTER_H
19
 
#define CPPJSONCONVERTER_H
 
18
#ifndef CPPJSONSPILLCONVERTER_H
 
19
#define CPPJSONSPILLCONVERTER_H
20
20
#include "json/json.h"
21
21
 
22
22
#include "src/common_cpp/Converter/ConverterBase.hh"
23
 
// #include "src/common_cpp/JsonCppStreamer/ConverterBase.hh"
24
 
#include "src/common_cpp/DataStructure/Spill.hh"
25
23
 
26
24
namespace MAUS {
27
25
 
 
26
class Data;
 
27
 
28
28
/*!
29
29
 * \class JsonCppConverter
30
30
 *
38
38
 * \author Alexander Richards, Imperial College London
39
39
 * \date 06/01/2012
40
40
 */
41
 
  class CppJsonConverter : public ConverterBase<Spill, Json::Value> {
 
41
  class CppJsonSpillConverter : public ConverterBase<Data, Json::Value> {
42
42
  public:
43
 
    CppJsonConverter()
44
 
      : ConverterBase<Spill, Json::Value>("CppJsonConverter") {}
 
43
    CppJsonSpillConverter()
 
44
      : ConverterBase<Data, Json::Value>("CppJsonSpillConverter") {}
45
45
 
46
46
  private:
47
47
    /*!
48
 
     * \brief Convert Json value
49
 
     * Overloaded process initiate the conversion process converting the
50
 
     * \a Json::Value given as the argument into the output type \a MausData
51
 
     *
52
 
     * \param Json::Value& The root \a Json::Value object from the Json data
53
 
     *        file
54
 
     * \return a pointer to the MausData object
55
 
     */
56
 
//     Spill* _convert(const Json::Value*) const;
57
 
 
58
 
    /*!
59
48
     * \brief Convert MausData
60
49
     * Overloaded process initiates the conversion process converting the
61
50
     * \a MausData given as the argument into the output type \a Json::Value
62
51
     *
63
52
     * \param MausData& The root \a MausData object from the cpp data structure
64
53
     * \return a pointer to the Json::Value object
 
54
     *
 
55
     * Some ugliness results from the fact that the Spill is written as the base
 
56
     * top level in Json, but for reasons of stupidity (Rogers) the Data is
 
57
     * written as the top level in ROOT. To make it worse, Spill doesn't always
 
58
     * hold spill data - as DAQ sometimes spits out start_of_burst or
 
59
     * calibration data.
65
60
     */
66
 
    Json::Value* _convert(const Spill*) const;
 
61
    Json::Value* _convert(const Data*) const;
67
62
 
68
63
  private:
69
64
};