WPILibC++
2020.3.2
Idle.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_IDLE_H_
9
#define WPIUTIL_WPI_UV_IDLE_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
37
class
Idle
final :
public
HandleImpl
<Idle, uv_idle_t> {
38
struct
private_init {};
39
40
public
:
41
explicit
Idle
(
const
private_init&) {}
42
~
Idle
() noexcept
override
=
default
;
43
49
static
std::shared_ptr<Idle>
Create
(
Loop
& loop);
50
56
static
std::shared_ptr<Idle>
Create
(
const
std::shared_ptr<Loop>& loop) {
57
return
Create
(*loop);
58
}
59
63
void
Start
();
64
68
void
Stop
() { Invoke(&uv_idle_stop,
GetRaw
()); }
69
73
sig::Signal<>
idle
;
74
};
75
76
}
// namespace uv
77
}
// namespace wpi
78
79
#endif // WPIUTIL_WPI_UV_IDLE_H_
wpi::uv::HandleImpl< Idle, uv_idle_t >::GetRaw
uv_idle_t * GetRaw() const noexcept
Get the underlying handle data structure.
Definition:
Handle.h:288
wpi::uv::Idle::Stop
void Stop()
Stop the handle.
Definition:
Idle.h:68
wpi::uv::Idle::Create
static std::shared_ptr< Idle > Create(const std::shared_ptr< Loop > &loop)
Create an idle handle.
Definition:
Idle.h:56
wpi
WPILib C++ utilities (wpiutil) namespace.
Definition:
EventLoopRunner.h:17
wpi::uv::Idle
Idle handle.
Definition:
Idle.h:37
wpi::uv::HandleImpl
Handle.
Definition:
Handle.h:273
wpi::uv::Idle::idle
sig::Signal idle
Signal generated once per loop iteration prior to Prepare signals.
Definition:
Idle.h:73
wpi::uv::Idle::Start
void Start()
Start the handle.
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
wpi::uv::Idle::Create
static std::shared_ptr< Idle > Create(Loop &loop)
Create an idle handle.
wpiutil
src
main
native
include
wpi
uv
Idle.h
Generated on Fri Feb 21 2020 08:50:37 for WPILibC++ by
1.8.16