WPILibC++ 2027.0.0-alpha-2
Loading...
Searching...
No Matches
OpMode.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 <stdint.h>
8
9#include <vector>
10
12
13#include "MrcComm.npb.h"
14#include "mrc/NetComm.h"
15
16template <>
17struct wpi::Protobuf<mrc::OpMode> {
18 using MessageStruct = mrc_proto_ProtobufOpMode;
21 static std::optional<mrc::OpMode> Unpack(InputStream& Stream);
22 static bool Pack(OutputStream& Stream, const mrc::OpMode& Value);
23};
24
25template <>
26struct wpi::Protobuf<std::vector<mrc::OpMode>> {
27 using MessageStruct = mrc_proto_ProtobufAvailableOpModes;
30 static std::optional<std::vector<mrc::OpMode>> Unpack(InputStream& Stream);
31 static bool Pack(OutputStream& Stream, const std::vector<mrc::OpMode>& Value);
32};
Class for wrapping a nanopb istream.
Definition Protobuf.h:55
Class for wrapping a nanopb ostream.
Definition Protobuf.h:119
Definition NetComm.h:19
Definition PointerIntPair.h:280
Definition NetComm.h:416
static std::optional< mrc::OpMode > Unpack(InputStream &Stream)
static bool Pack(OutputStream &Stream, const mrc::OpMode &Value)
mrc_proto_ProtobufOpMode MessageStruct
Definition OpMode.h:18
mrc_proto_ProtobufAvailableOpModes MessageStruct
Definition OpMode.h:27
static bool Pack(OutputStream &Stream, const std::vector< mrc::OpMode > &Value)
static std::optional< std::vector< mrc::OpMode > > Unpack(InputStream &Stream)
Protobuf serialization template.
Definition Protobuf.h:36