WPILibC++ 2023.4.3-108-ge5452e3
CameraServerShared.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 <memory>
8#include <thread>
9#include <utility>
10
11#include <fmt/format.h>
12
13namespace frc {
15 public:
16 virtual ~CameraServerShared() = default;
17 virtual void ReportUsbCamera(int id) = 0;
18 virtual void ReportAxisCamera(int id) = 0;
19 virtual void ReportVideoServer(int id) = 0;
21 fmt::format_args args) = 0;
23 fmt::format_args args) = 0;
25 fmt::format_args args) = 0;
26 virtual std::pair<std::thread::id, bool> GetRobotMainThreadId() const = 0;
27
28 template <typename S, typename... Args>
29 inline void SetCameraServerError(const S& format, Args&&... args) {
31 }
32
33 template <typename S, typename... Args>
34 inline void SetVisionRunnerError(const S& format, Args&&... args) {
36 }
37
38 template <typename S, typename... Args>
39 inline void ReportDriverStationError(const S& format, Args&&... args) {
41 }
42};
43
45} // namespace frc
46
47extern "C" {
48// Takes ownership
50} // extern "C"
void CameraServer_SetCameraServerShared(frc::CameraServerShared *shared)
Definition: CameraServerShared.h:14
void ReportDriverStationError(const S &format, Args &&... args)
Definition: CameraServerShared.h:39
virtual void SetVisionRunnerErrorV(fmt::string_view format, fmt::format_args args)=0
virtual void ReportAxisCamera(int id)=0
virtual void ReportUsbCamera(int id)=0
virtual void ReportDriverStationErrorV(fmt::string_view format, fmt::format_args args)=0
virtual ~CameraServerShared()=default
virtual void SetCameraServerErrorV(fmt::string_view format, fmt::format_args args)=0
virtual std::pair< std::thread::id, bool > GetRobotMainThreadId() const =0
virtual void ReportVideoServer(int id)=0
void SetVisionRunnerError(const S &format, Args &&... args)
Definition: CameraServerShared.h:34
void SetCameraServerError(const S &format, Args &&... args)
Definition: CameraServerShared.h:29
basic_string_view< char > string_view
Definition: core.h:520
constexpr auto make_format_args(Args &&... args) -> format_arg_store< Context, remove_cvref_t< Args >... >
\rst Constructs a ~fmtformat_arg_store object that contains references to arguments and can be implic...
Definition: core.h:1923
basic_format_args< format_context > format_args
An alias to basic_format_args<format_context>.
Definition: core.h:2069
Definition: AprilTagPoseEstimator.h:15
CameraServerShared * GetCameraServerShared()
#define S(label, offset, message)
Definition: Errors.h:119
auto format(wformat_string< T... > fmt, T &&... args) -> std::wstring
Definition: xchar.h:87