mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Make many more utility classes/headers public. (#76)
Moving these headers from src to include enables other libraries to use the functionality provided. * tcpsockets * atomic_static * raw_istream * timestamp * SafeThread * Base64 * LEB128 * ConcurrentQueue The classes have been moved into the wpi namespace as they're generic.
This commit is contained in:
@@ -11,8 +11,9 @@
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "Dispatcher.h"
|
||||
#include "support/timestamp.h"
|
||||
#include "Log.h"
|
||||
#include "Dispatcher.h"
|
||||
#include "Notifier.h"
|
||||
#include "RpcServer.h"
|
||||
#include "Storage.h"
|
||||
@@ -168,7 +169,7 @@ std::string PackRpcDefinition(const RpcDefinition& def) {
|
||||
}
|
||||
|
||||
bool UnpackRpcDefinition(StringRef packed, RpcDefinition* def) {
|
||||
raw_mem_istream is(packed.data(), packed.size());
|
||||
wpi::raw_mem_istream is(packed.data(), packed.size());
|
||||
WireDecoder dec(is, 0x0300);
|
||||
if (!dec.Read8(&def->version)) return false;
|
||||
if (!dec.ReadString(&def->name)) return false;
|
||||
@@ -211,7 +212,7 @@ std::string PackRpcValues(ArrayRef<std::shared_ptr<Value>> values) {
|
||||
|
||||
std::vector<std::shared_ptr<Value>> UnpackRpcValues(StringRef packed,
|
||||
ArrayRef<NT_Type> types) {
|
||||
raw_mem_istream is(packed.data(), packed.size());
|
||||
wpi::raw_mem_istream is(packed.data(), packed.size());
|
||||
WireDecoder dec(is, 0x0300);
|
||||
std::vector<std::shared_ptr<Value>> vec;
|
||||
for (auto type : types) {
|
||||
@@ -281,6 +282,10 @@ const char* LoadPersistent(
|
||||
return Storage::GetInstance().LoadPersistent(filename, warn);
|
||||
}
|
||||
|
||||
unsigned long long Now() {
|
||||
return wpi::Now();
|
||||
}
|
||||
|
||||
void SetLogger(LogFunc func, unsigned int min_level) {
|
||||
Logger& logger = Logger::GetInstance();
|
||||
logger.SetLogger(func);
|
||||
|
||||
Reference in New Issue
Block a user