WPILibC++ 2025.0.0-alpha-1-10-g1ccd8d1
Ellipse2dStruct.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
7#include <wpi/SymbolExports.h>
8#include <wpi/struct/Struct.h>
9
11
12template <>
13struct WPILIB_DLLEXPORT wpi::Struct<frc::Ellipse2d> {
14 static constexpr std::string_view GetTypeString() {
15 return "struct:Ellipse2d";
16 }
17 static constexpr size_t GetSize() {
18 return wpi::GetStructSize<frc::Pose2d>() + 16;
19 }
20 static constexpr std::string_view GetSchema() {
21 return "Pose2d center;double xSemiAxis;double ySemiAxis";
22 }
23
24 static frc::Ellipse2d Unpack(std::span<const uint8_t> data);
25 static void Pack(std::span<uint8_t> data, const frc::Ellipse2d& value);
26 static void ForEachNested(
27 std::invocable<std::string_view, std::string_view> auto fn) {
28 wpi::ForEachStructSchema<frc::Pose2d>(fn);
29 }
30};
31
#define WPILIB_DLLEXPORT
Definition: SymbolExports.h:36
Represents a 2d ellipse space containing translational, rotational, and scaling components.
Definition: Ellipse2d.h:26
Specifies that a struct type has nested struct declarations.
Definition: Struct.h:119
Specifies that a type is capable of raw struct serialization and deserialization.
Definition: Struct.h:68
basic_string_view< char > string_view
Definition: core.h:518
Definition: ntcore_cpp.h:26
static void Pack(std::span< uint8_t > data, const frc::Ellipse2d &value)
static void ForEachNested(std::invocable< std::string_view, std::string_view > auto fn)
Definition: Ellipse2dStruct.h:26
static constexpr std::string_view GetTypeString()
Definition: Ellipse2dStruct.h:14
static constexpr std::string_view GetSchema()
Definition: Ellipse2dStruct.h:20
static constexpr size_t GetSize()
Definition: Ellipse2dStruct.h:17
static frc::Ellipse2d Unpack(std::span< const uint8_t > data)