Include .h from .inc/.inl files (NFC) (#3017)

This helps both IDEs and linting tools.

Also add some missing braces.
This commit is contained in:
Peter Johnson
2020-12-31 11:26:53 -08:00
committed by GitHub
parent bf8f8710ea
commit b7e46c558f
23 changed files with 129 additions and 50 deletions

View File

@@ -7,6 +7,8 @@
#include <functional>
#include <vector>
#include "frc/SpeedControllerGroup.h"
namespace frc {
template <class... SpeedControllers>

View File

@@ -7,6 +7,8 @@
#include <memory>
#include <string>
#include "frc/shuffleboard/ShuffleboardComponent.h"
namespace frc {
template <typename Derived>

View File

@@ -12,6 +12,8 @@
#include <wpi/StringRef.h>
#include "frc/smartdashboard/SendableChooser.h"
namespace frc {
template <class T>
@@ -31,8 +33,9 @@ auto SendableChooser<T>::GetSelected()
std::string selected = m_defaultChoice;
{
std::scoped_lock lock(m_mutex);
if (m_haveSelected)
if (m_haveSelected) {
selected = m_selected;
}
}
if (selected.empty()) {
return decltype(_unwrap_smart_ptr(m_choices[""])){};
@@ -86,8 +89,9 @@ void SendableChooser<T>::InitSendable(SendableBuilder& builder) {
std::scoped_lock lock(m_mutex);
m_haveSelected = true;
m_selected = val;
for (auto& entry : m_activeEntries)
for (auto& entry : m_activeEntries) {
entry.SetString(val);
}
});
}