Owns one frame header and the list of payloads accumulated for that frame.
More...
#include <gFrameDataCollection.h>
Definition at line 48 of file gFrameDataCollection.h.
◆ GFrameDataCollection() [1/3]
| GFrameDataCollection::GFrameDataCollection |
( |
GFrameHeader * | header, |
|
|
std::shared_ptr< GLogger > | logger ) |
|
inline |
Ownership:
header is adopted by this object and deleted in the destructor
Internal storage:
- the payload pointer vector is allocated on the heap for historical reasons
- Parameters
-
| header | Frame header pointer. Ownership is transferred to this object. |
| logger | Logger instance used for diagnostics. |
Definition at line 64 of file gFrameDataCollection.h.
◆ GFrameDataCollection() [2/3]
◆ GFrameDataCollection() [3/3]
◆ ~GFrameDataCollection()
| GFrameDataCollection::~GFrameDataCollection |
( |
| ) |
|
|
inline |
Deletes in the following order:
- the owned frame header
- all owned payload pointers
- the payload vector container
- Warning
- Any pointers previously returned by getHeader() or getIntegralPayload() become invalid after destruction.
Definition at line 91 of file gFrameDataCollection.h.
◆ addEvent()
| void GFrameDataCollection::addEvent |
( |
int | evn | ) |
|
Intended future usage:
- accept an event number or event object
- integrate it into this frame's payload list by collecting channels hit during the frame window
- Parameters
-
◆ addIntegralPayload()
| void GFrameDataCollection::addIntegralPayload |
( |
std::vector< int > | payload | ) |
const |
|
inline |
The payload is passed as a vector to support a generic packed interface, typically used when data come from external buffers or electronics emulators.
Expected layout, size must be exactly 5:
- payload[0] = crate
- payload[1] = slot
- payload[2] = channel
- payload[3] = charge
- payload[4] = time
On success:
On failure:
- Parameters
-
| payload | Packed payload vector with exactly five integer entries. |
Definition at line 122 of file gFrameDataCollection.h.
◆ getFrameID()
| long int GFrameDataCollection::getFrameID |
( |
| ) |
const |
|
inline |
◆ getHeader()
| const GFrameHeader * GFrameDataCollection::getHeader |
( |
| ) |
const |
|
inline |
The returned pointer remains valid as long as this GFrameDataCollection exists. The header is owned by this object and must not be deleted by the caller.
- Returns
- Pointer to the frame header owned by this object.
Definition at line 177 of file gFrameDataCollection.h.
◆ getIntegralPayload()
| const std::vector< GIntegralPayload * > * GFrameDataCollection::getIntegralPayload |
( |
| ) |
const |
|
inline |
The returned pointers:
- are owned by this object
- remain valid only as long as the collection exists
- must not be deleted by the caller
- Returns
- Pointer to the internal payload vector.
Definition at line 190 of file gFrameDataCollection.h.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ shouldWriteFrame()
| bool GFrameDataCollection::shouldWriteFrame |
( |
| ) |
const |
Intended future usage:
- decide whether enough data has accumulated
- decide whether the frame time window has elapsed
- trigger writing this frame to an output stream
- Returns
true if the frame should be written.
The documentation for this class was generated from the following file: