gdata
Loading...
Searching...
No Matches
gIntegralPayload.h
Go to the documentation of this file.
1#pragma once
2
20#include "glogger.h"
21#include <vector>
22
24{
25public:
40 GIntegralPayload(int c, int s, int ch, int q, int t, std::shared_ptr<GLogger> logger)
41 : log(logger), crate(c), slot(s), channel(ch), charge(q), time(t) {
42 log->debug(CONSTRUCTOR, "GIntegralPayload crate ", crate, " slot ", slot, " channel ", channel, " charge ",
43 charge, " time ", time);
44 }
45
53 log->debug(DESTRUCTOR, "GIntegralPayload crate ", crate, " slot ", slot, " channel ", channel, " charge ",
54 charge, " time ", time);
55 }
56
73 [[nodiscard]] std::vector<int> getPayload() const {
74 std::vector<int> payload;
75 payload.push_back(crate);
76 payload.push_back(slot);
77 payload.push_back(channel);
78 payload.push_back(charge);
79 payload.push_back(time);
80 return payload;
81 }
82
83private:
84 std::shared_ptr<GLogger> log;
85 int crate;
86 int slot;
87 int channel;
88 int charge;
89 int time;
90};
void debug(debug_type type, Args &&... args) const
CONSTRUCTOR
DESTRUCTOR
GIntegralPayload(int c, int s, int ch, int q, int t, std::shared_ptr< GLogger > logger)
Construct an integral payload.
~GIntegralPayload()
Destructor (logs for debug builds/configurations).
std::vector< int > getPayload() const
Export payload as a fixed-order vector of integers.