gdata
Loading...
Searching...
No Matches
gFrameDataCollection.h File Reference

Defines GFrameDataCollection, a container for frame-level integrated payloads. More...

#include "gFrameHeader.h"
#include "gIntegralPayload.h"
#include "gdataConventions.h"
#include <vector>
Include dependency graph for gFrameDataCollection.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  GFrameDataCollection
 

Detailed Description

A frame collection groups multiple GIntegralPayload objects under a single GFrameHeader. This models streaming/readout output where many channels may fire within a time window ("frame").

Ownership model (current implementation):

  • GFrameDataCollection adopts the GFrameHeader pointer passed at construction and deletes it in the destructor.
  • Payloads are allocated with new in addIntegralPayload() and deleted in the destructor.
  • The internal payload container is also heap-allocated and deleted in the destructor.
Note
The class uses raw pointers today. If/when modernized, the natural replacement is std::unique_ptr<GFrameHeader> and std::vector<std::unique_ptr<GIntegralPayload>>.
Warning
Because raw pointers are used, callers must follow the ownership rules strictly:
  • do not delete the header after passing it to the constructor
  • do not delete payload pointers returned by getIntegralPayload()
  • do not store returned pointers beyond the lifetime of the owning GFrameDataCollection

Definition in file gFrameDataCollection.h.