WPILibC++
2020.3.2
Check.h
1
/*----------------------------------------------------------------------------*/
2
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
3
/* Open Source Software - may be modified and shared by FRC teams. The code */
4
/* must be accompanied by the FIRST BSD license file in the root directory of */
5
/* the project. */
6
/*----------------------------------------------------------------------------*/
7
8
#ifndef WPIUTIL_WPI_UV_CHECK_H_
9
#define WPIUTIL_WPI_UV_CHECK_H_
10
11
#include <uv.h>
12
13
#include <memory>
14
15
#include "wpi/Signal.h"
16
#include "wpi/uv/Handle.h"
17
18
namespace
wpi
{
19
namespace
uv {
20
21
class
Loop;
22
28
class
Check
final :
public
HandleImpl
<Check, uv_check_t> {
29
struct
private_init {};
30
31
public
:
32
explicit
Check
(
const
private_init&) {}
33
~
Check
() noexcept
override
=
default
;
34
40
static
std::shared_ptr<Check>
Create
(
Loop
& loop);
41
47
static
std::shared_ptr<Check>
Create
(
const
std::shared_ptr<Loop>& loop) {
48
return
Create
(*loop);
49
}
50
54
void
Start
();
55
59
void
Stop
() { Invoke(&uv_check_stop,
GetRaw
()); }
60
64
sig::Signal<>
check
;
65
};
66
67
}
// namespace uv
68
}
// namespace wpi
69
70
#endif // WPIUTIL_WPI_UV_CHECK_H_
wpi::uv::HandleImpl< Check, uv_check_t >::GetRaw
uv_check_t * GetRaw() const noexcept
Get the underlying handle data structure.
Definition:
Handle.h:288
wpi::uv::Check::Create
static std::shared_ptr< Check > Create(const std::shared_ptr< Loop > &loop)
Create a check handle.
Definition:
Check.h:47
wpi::uv::Check::check
sig::Signal check
Signal generated once per loop iteration after polling for I/O.
Definition:
Check.h:64
wpi::uv::Check::Stop
void Stop()
Stop the handle.
Definition:
Check.h:59
wpi::uv::Check::Start
void Start()
Start the handle.
wpi::uv::Check::Create
static std::shared_ptr< Check > Create(Loop &loop)
Create a check handle.
wpi
WPILib C++ utilities (wpiutil) namespace.
Definition:
EventLoopRunner.h:17
wpi::uv::Check
Check handle.
Definition:
Check.h:28
wpi::uv::HandleImpl
Handle.
Definition:
Handle.h:273
wpi::uv::Loop
Event loop.
Definition:
Loop.h:39
wpi::sig::SignalBase
SignalBase is an implementation of the observer pattern, through the use of an emitting object and sl...
Definition:
Signal.h:495
wpiutil
src
main
native
include
wpi
uv
Check.h
Generated on Fri Feb 21 2020 08:50:37 for WPILibC++ by
1.8.16