Voyant API 0.2.1
Loading...
Searching...
No Matches
point_group_wrapper.hpp
Go to the documentation of this file.
1// Copyright (c) 2024-2025 Voyant Photonics, Inc.
2// All rights reserved.
3
4#pragma once
5#include "../capnp_wrapper.h"
7#include "point_group.capnp.h"
10#include <array>
11
18class PointGroupWrapper : public CapnpWrapper<PointGroup>
19{
20private:
21 VoyantHeaderWrapper header_;
22 PointGroupHeaderWrapper pointGroupHeader_;
23 std::array<DataBlockWrapper, 4> dataBlocks_;
24
25public:
30
35 void fromProto(PointGroup::Reader reader) override;
36
41 void toProto(PointGroup::Builder &builder) const override;
42
47 void debugString(std::ostream &os) const override;
48
49 // Getters and setters
54 const VoyantHeaderWrapper &header() const { return header_; }
55
60 VoyantHeaderWrapper &headerMut() { return header_; }
61
66 const PointGroupHeaderWrapper &pointGroupHeader() const { return pointGroupHeader_; }
67
72 PointGroupHeaderWrapper &pointGroupHeaderMut() { return pointGroupHeader_; }
73
78 const std::array<DataBlockWrapper, 4> &dataBlocks() const { return dataBlocks_; }
79
84 std::array<DataBlockWrapper, 4> &dataBlocksMut() { return dataBlocks_; }
85
93
98 uint32_t countValidPoints() const;
99
106 bool isPointValid(size_t blockIdx, size_t channelIdx) const;
107
112};
Base template class for Cap'n Proto wrappers.
Definition capnp_wrapper.h:23
Wrapper for PointGroupHeader messages.
Definition point_group_header_wrapper.hpp:15
Wrapper for PointGroup messages.
Definition point_group_wrapper.hpp:19
uint32_t countValidPoints() const
Count the number of valid points in the group.
void fromProto(PointGroup::Reader reader) override
Update wrapper fields from a reader.
~PointGroupWrapper() override
Destructor.
void debugString(std::ostream &os) const override
Generate a debug string representation.
std::array< DataBlockWrapper, 4 > & dataBlocksMut()
Get mutable access to the array of data blocks.
Definition point_group_wrapper.hpp:84
bool isPointValid(size_t blockIdx, size_t channelIdx) const
Check if a specific point is valid.
const PointGroupHeaderWrapper & pointGroupHeader() const
Get the point group header.
Definition point_group_wrapper.hpp:66
void toProto(PointGroup::Builder &builder) const override
Write wrapper fields to a builder.
const std::array< DataBlockWrapper, 4 > & dataBlocks() const
Get the array of data blocks.
Definition point_group_wrapper.hpp:78
void reset_data_blocks()
Reset all data blocks to their default state.
PointGroupHeaderWrapper & pointGroupHeaderMut()
Get mutable access to the point group header.
Definition point_group_wrapper.hpp:72
void updateValidPoints()
Calculate and set the valid points bitfield based on drop reasons.
VoyantHeaderWrapper & headerMut()
Get mutable access to the common header.
Definition point_group_wrapper.hpp:60
const VoyantHeaderWrapper & header() const
Get the common header.
Definition point_group_wrapper.hpp:54
Definition point_group.capnp.h:370
Definition point_group.capnp.h:323
Wrapper for VoyantHeader messages.
Definition voyant_header_wrapper.hpp:43