Files
allwpilib/simulation/halsim_ws_server/src/main/native/include/HALSimWSServer.h
Peter Johnson f86a5f9b09 [sim] WebSockets: don't override HAL_Main
Also clean up some other implementation aspects for cleaner shutdown and
reduce peak memory allocation.
2020-09-04 16:26:09 -07:00

35 lines
1.0 KiB
C++

/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <memory>
#include <WSProviderContainer.h>
#include <WSProvider_SimDevice.h>
#include <wpi/EventLoopRunner.h>
#include "HALSimWeb.h"
namespace wpilibws {
class HALSimWSServer {
public:
HALSimWSServer() = default;
HALSimWSServer(const HALSimWSServer&) = delete;
HALSimWSServer& operator=(const HALSimWSServer&) = delete;
bool Initialize();
ProviderContainer providers;
HALSimWSProviderSimDevices simDevices{providers};
wpi::EventLoopRunner runner;
std::shared_ptr<HALSimWeb> simWeb;
};
} // namespace wpilibws