2023-08-03 23:43:55 -07:00
|
|
|
// Copyright (c) FIRST and other WPILib contributors.
|
|
|
|
|
// Open Source Software; you can modify and/or share it under the terms of
|
|
|
|
|
// the WPILib BSD license file in the root directory of this project.
|
|
|
|
|
|
|
|
|
|
#include "ValueCircularBuffer.h"
|
|
|
|
|
|
|
|
|
|
using namespace nt;
|
|
|
|
|
|
2024-01-19 20:38:01 -08:00
|
|
|
std::vector<Value> ValueCircularBuffer::ReadValue(unsigned int types) {
|
2023-08-03 23:43:55 -07:00
|
|
|
std::vector<Value> rv;
|
|
|
|
|
rv.reserve(m_storage.size());
|
|
|
|
|
for (auto&& val : m_storage) {
|
2024-01-19 20:38:01 -08:00
|
|
|
if (types != 0 && (types & val.type()) == 0) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
2023-08-03 23:43:55 -07:00
|
|
|
rv.emplace_back(std::move(val));
|
|
|
|
|
}
|
|
|
|
|
m_storage.reset();
|
|
|
|
|
return rv;
|
|
|
|
|
}
|