WPILibC++
2025.2.1
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 <thread>
9
#include <utility>
10
11
#include <
fmt/format.h
>
12
13
namespace
frc
{
14
class
CameraServerShared
{
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;
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:14
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::ReportAxisCamera
virtual void ReportAxisCamera(int id)=0
frc::CameraServerShared::ReportUsbCamera
virtual void ReportUsbCamera(int id)=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::ReportVideoServer
virtual void ReportVideoServer(int id)=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(detail::locale_ref loc, format_string< T... > fmt, T &&... args) -> std::string
Definition
format.h:4146
frc
Definition
CAN.h:11
frc::GetCameraServerShared
CameraServerShared * GetCameraServerShared()
S
#define S(label, offset, message)
Definition
Errors.h:113
cameraserver
CameraServerShared.h
Generated on Fri Jan 10 2025 07:37:19 for WPILibC++ by
1.12.0