Use wpi::span instead of wpi::ArrayRef across all libraries (#3414)

- Remove ArrayRef.h
- Add SpanExtras.h for a couple of convenience functions
This commit is contained in:
Peter Johnson
2021-06-06 19:51:14 -07:00
committed by GitHub
parent 2abbbd9e70
commit 64f5413253
167 changed files with 974 additions and 1433 deletions

View File

@@ -16,6 +16,7 @@
#include <wpi/condition_variable.h>
#include <wpi/mutex.h>
#include <wpi/span.h>
#include "IDispatcher.h"
#include "INetworkConnection.h"
@@ -77,11 +78,11 @@ class DispatcherBase : public IDispatcher {
bool ClientHandshake(
NetworkConnection& conn,
std::function<std::shared_ptr<Message>()> get_msg,
std::function<void(wpi::ArrayRef<std::shared_ptr<Message>>)> send_msgs);
std::function<void(wpi::span<std::shared_ptr<Message>>)> send_msgs);
bool ServerHandshake(
NetworkConnection& conn,
std::function<std::shared_ptr<Message>()> get_msg,
std::function<void(wpi::ArrayRef<std::shared_ptr<Message>>)> send_msgs);
std::function<void(wpi::span<std::shared_ptr<Message>>)> send_msgs);
void ClientReconnect(unsigned int proto_rev = 0x0300);
@@ -136,7 +137,7 @@ class Dispatcher : public DispatcherBase {
void SetServer(const char* server_name, unsigned int port);
void SetServer(
wpi::ArrayRef<std::pair<std::string_view, unsigned int>> servers);
wpi::span<const std::pair<std::string_view, unsigned int>> servers);
void SetServerTeam(unsigned int team, unsigned int port);
void SetServerOverride(const char* server_name, unsigned int port);