WPILibC++
2027.0.0-alpha-2
Loading...
Searching...
No Matches
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 <string_view>
9
#include <thread>
10
#include <utility>
11
12
#include <
fmt/format.h
>
13
14
namespace
frc
{
15
class
CameraServerShared
{
16
public
:
17
virtual
~CameraServerShared
() =
default
;
18
virtual
void
ReportUsage
(std::string_view resource,
19
std::string_view data) = 0;
20
virtual
void
SetCameraServerErrorV
(fmt::string_view
format
,
21
fmt::format_args args) = 0;
22
virtual
void
SetVisionRunnerErrorV
(fmt::string_view
format
,
23
fmt::format_args args) = 0;
24
virtual
void
ReportDriverStationErrorV
(fmt::string_view
format
,
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) {
30
SetCameraServerErrorV
(
format
, fmt::make_format_args(args...));
31
}
32
33
template
<
typename
S
,
typename
... Args>
34
inline
void
SetVisionRunnerError
(
const
S
&
format
, Args&&... args) {
35
SetVisionRunnerErrorV
(
format
, fmt::make_format_args(args...));
36
}
37
38
template
<
typename
S
,
typename
... Args>
39
inline
void
ReportDriverStationError
(
const
S
&
format
, Args&&... args) {
40
ReportDriverStationErrorV
(
format
, fmt::make_format_args(args...));
41
}
42
};
43
44
CameraServerShared
*
GetCameraServerShared
();
45
}
// namespace frc
46
47
extern
"C"
{
48
// Takes ownership
49
void
CameraServer_SetCameraServerShared
(
frc::CameraServerShared
* shared);
50
}
// extern "C"
CameraServer_SetCameraServerShared
void CameraServer_SetCameraServerShared(frc::CameraServerShared *shared)
frc::CameraServerShared
Definition
CameraServerShared.h:15
frc::CameraServerShared::ReportDriverStationError
void ReportDriverStationError(const S &format, Args &&... args)
Definition
CameraServerShared.h:39
frc::CameraServerShared::SetVisionRunnerErrorV
virtual void SetVisionRunnerErrorV(fmt::string_view format, fmt::format_args args)=0
frc::CameraServerShared::ReportUsage
virtual void ReportUsage(std::string_view resource, std::string_view data)=0
frc::CameraServerShared::ReportDriverStationErrorV
virtual void ReportDriverStationErrorV(fmt::string_view format, fmt::format_args args)=0
frc::CameraServerShared::~CameraServerShared
virtual ~CameraServerShared()=default
frc::CameraServerShared::SetCameraServerErrorV
virtual void SetCameraServerErrorV(fmt::string_view format, fmt::format_args args)=0
frc::CameraServerShared::GetRobotMainThreadId
virtual std::pair< std::thread::id, bool > GetRobotMainThreadId() const =0
frc::CameraServerShared::SetVisionRunnerError
void SetVisionRunnerError(const S &format, Args &&... args)
Definition
CameraServerShared.h:34
frc::CameraServerShared::SetCameraServerError
void SetCameraServerError(const S &format, Args &&... args)
Definition
CameraServerShared.h:29
format.h
format
FMT_INLINE auto format(const Locale &loc, format_string< T... > fmt, T &&... args) -> std::string
Definition
format.h:4252
frc
Definition
SystemServer.h:9
frc::GetCameraServerShared
CameraServerShared * GetCameraServerShared()
S
#define S(label, offset, message)
Definition
Errors.h:113
cameraserver
CameraServerShared.h
Generated on Wed Jul 23 2025 00:48:17 for WPILibC++ by
1.12.0