WPILibC++ 2024.3.2
ntcore_cpp_types.h File Reference
#include <stdint.h>
#include <span>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include "ntcore_c.h"

Go to the source code of this file.

Classes

struct  nt::Timestamped< T >
 Timestamped value. More...
 

Namespaces

namespace  wpi
 
namespace  nt
 NetworkTables (ntcore) namespace.
 

Typedefs

using nt::TimestampedBoolean = Timestamped< bool >
 Timestamped Boolean. More...
 
using nt::TimestampedInteger = Timestamped< int64_t >
 Timestamped Integer. More...
 
using nt::TimestampedFloat = Timestamped< float >
 Timestamped Float. More...
 
using nt::TimestampedDouble = Timestamped< double >
 Timestamped Double. More...
 
using nt::TimestampedString = Timestamped< std::string >
 Timestamped String. More...
 
using nt::TimestampedStringView = Timestamped< std::string_view >
 Timestamped String view (for SmallVector-taking functions). More...
 
using nt::TimestampedRaw = Timestamped< std::vector< uint8_t > >
 Timestamped Raw. More...
 
using nt::TimestampedRawView = Timestamped< std::span< uint8_t > >
 Timestamped Raw view (for SmallVector-taking functions). More...
 
using nt::TimestampedBooleanArray = Timestamped< std::vector< int > >
 Timestamped BooleanArray. More...
 
using nt::TimestampedBooleanArrayView = Timestamped< std::span< int > >
 Timestamped BooleanArray view (for SmallVector-taking functions). More...
 
using nt::TimestampedIntegerArray = Timestamped< std::vector< int64_t > >
 Timestamped IntegerArray. More...
 
using nt::TimestampedIntegerArrayView = Timestamped< std::span< int64_t > >
 Timestamped IntegerArray view (for SmallVector-taking functions). More...
 
using nt::TimestampedFloatArray = Timestamped< std::vector< float > >
 Timestamped FloatArray. More...
 
using nt::TimestampedFloatArrayView = Timestamped< std::span< float > >
 Timestamped FloatArray view (for SmallVector-taking functions). More...
 
using nt::TimestampedDoubleArray = Timestamped< std::vector< double > >
 Timestamped DoubleArray. More...
 
using nt::TimestampedDoubleArrayView = Timestamped< std::span< double > >
 Timestamped DoubleArray view (for SmallVector-taking functions). More...
 
using nt::TimestampedStringArray = Timestamped< std::vector< std::string > >
 Timestamped StringArray. More...
 

Functions

bool nt::SetBoolean (NT_Handle pubentry, bool value, int64_t time=0)
 Publish a new value. More...
 
bool nt::SetDefaultBoolean (NT_Handle pubentry, bool defaultValue)
 Publish a default value. More...
 
bool nt::GetBoolean (NT_Handle subentry, bool defaultValue)
 Get the last published value. More...
 
TimestampedBoolean nt::GetAtomicBoolean (NT_Handle subentry, bool defaultValue)
 Get the last published value along with its timestamp. More...
 
std::vector< TimestampedBoolean > nt::ReadQueueBoolean (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
std::vector< int > nt::ReadQueueValuesBoolean (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
bool nt::SetInteger (NT_Handle pubentry, int64_t value, int64_t time=0)
 Publish a new value. More...
 
bool nt::SetDefaultInteger (NT_Handle pubentry, int64_t defaultValue)
 Publish a default value. More...
 
int64_t nt::GetInteger (NT_Handle subentry, int64_t defaultValue)
 Get the last published value. More...
 
TimestampedInteger nt::GetAtomicInteger (NT_Handle subentry, int64_t defaultValue)
 Get the last published value along with its timestamp. More...
 
std::vector< TimestampedInteger > nt::ReadQueueInteger (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
std::vector< int64_t > nt::ReadQueueValuesInteger (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
bool nt::SetFloat (NT_Handle pubentry, float value, int64_t time=0)
 Publish a new value. More...
 
bool nt::SetDefaultFloat (NT_Handle pubentry, float defaultValue)
 Publish a default value. More...
 
float nt::GetFloat (NT_Handle subentry, float defaultValue)
 Get the last published value. More...
 
TimestampedFloat nt::GetAtomicFloat (NT_Handle subentry, float defaultValue)
 Get the last published value along with its timestamp. More...
 
std::vector< TimestampedFloat > nt::ReadQueueFloat (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
std::vector< float > nt::ReadQueueValuesFloat (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
bool nt::SetDouble (NT_Handle pubentry, double value, int64_t time=0)
 Publish a new value. More...
 
bool nt::SetDefaultDouble (NT_Handle pubentry, double defaultValue)
 Publish a default value. More...
 
double nt::GetDouble (NT_Handle subentry, double defaultValue)
 Get the last published value. More...
 
TimestampedDouble nt::GetAtomicDouble (NT_Handle subentry, double defaultValue)
 Get the last published value along with its timestamp. More...
 
std::vector< TimestampedDouble > nt::ReadQueueDouble (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
std::vector< double > nt::ReadQueueValuesDouble (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
bool nt::SetString (NT_Handle pubentry, std::string_view value, int64_t time=0)
 Publish a new value. More...
 
bool nt::SetDefaultString (NT_Handle pubentry, std::string_view defaultValue)
 Publish a default value. More...
 
std::string nt::GetString (NT_Handle subentry, std::string_view defaultValue)
 Get the last published value. More...
 
TimestampedString nt::GetAtomicString (NT_Handle subentry, std::string_view defaultValue)
 Get the last published value along with its timestamp. More...
 
std::vector< TimestampedString > nt::ReadQueueString (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
std::vector< std::string > nt::ReadQueueValuesString (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
std::string_view nt::GetString (NT_Handle subentry, wpi::SmallVectorImpl< char > &buf, std::string_view defaultValue)
 
TimestampedStringView nt::GetAtomicString (NT_Handle subentry, wpi::SmallVectorImpl< char > &buf, std::string_view defaultValue)
 
bool nt::SetRaw (NT_Handle pubentry, std::span< const uint8_t > value, int64_t time=0)
 Publish a new value. More...
 
bool nt::SetDefaultRaw (NT_Handle pubentry, std::span< const uint8_t > defaultValue)
 Publish a default value. More...
 
std::vector< uint8_t > nt::GetRaw (NT_Handle subentry, std::span< const uint8_t > defaultValue)
 Get the last published value. More...
 
TimestampedRaw nt::GetAtomicRaw (NT_Handle subentry, std::span< const uint8_t > defaultValue)
 Get the last published value along with its timestamp. More...
 
std::vector< TimestampedRaw > nt::ReadQueueRaw (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
std::vector< std::vector< uint8_t > > nt::ReadQueueValuesRaw (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
std::span< uint8_t > nt::GetRaw (NT_Handle subentry, wpi::SmallVectorImpl< uint8_t > &buf, std::span< const uint8_t > defaultValue)
 
TimestampedRawView nt::GetAtomicRaw (NT_Handle subentry, wpi::SmallVectorImpl< uint8_t > &buf, std::span< const uint8_t > defaultValue)
 
bool nt::SetBooleanArray (NT_Handle pubentry, std::span< const int > value, int64_t time=0)
 Publish a new value. More...
 
bool nt::SetDefaultBooleanArray (NT_Handle pubentry, std::span< const int > defaultValue)
 Publish a default value. More...
 
std::vector< int > nt::GetBooleanArray (NT_Handle subentry, std::span< const int > defaultValue)
 Get the last published value. More...
 
TimestampedBooleanArray nt::GetAtomicBooleanArray (NT_Handle subentry, std::span< const int > defaultValue)
 Get the last published value along with its timestamp. More...
 
std::vector< TimestampedBooleanArray > nt::ReadQueueBooleanArray (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
std::vector< std::vector< int > > nt::ReadQueueValuesBooleanArray (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
std::span< int > nt::GetBooleanArray (NT_Handle subentry, wpi::SmallVectorImpl< int > &buf, std::span< const int > defaultValue)
 
TimestampedBooleanArrayView nt::GetAtomicBooleanArray (NT_Handle subentry, wpi::SmallVectorImpl< int > &buf, std::span< const int > defaultValue)
 
bool nt::SetIntegerArray (NT_Handle pubentry, std::span< const int64_t > value, int64_t time=0)
 Publish a new value. More...
 
bool nt::SetDefaultIntegerArray (NT_Handle pubentry, std::span< const int64_t > defaultValue)
 Publish a default value. More...
 
std::vector< int64_t > nt::GetIntegerArray (NT_Handle subentry, std::span< const int64_t > defaultValue)
 Get the last published value. More...
 
TimestampedIntegerArray nt::GetAtomicIntegerArray (NT_Handle subentry, std::span< const int64_t > defaultValue)
 Get the last published value along with its timestamp. More...
 
std::vector< TimestampedIntegerArray > nt::ReadQueueIntegerArray (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
std::vector< std::vector< int64_t > > nt::ReadQueueValuesIntegerArray (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
std::span< int64_t > nt::GetIntegerArray (NT_Handle subentry, wpi::SmallVectorImpl< int64_t > &buf, std::span< const int64_t > defaultValue)
 
TimestampedIntegerArrayView nt::GetAtomicIntegerArray (NT_Handle subentry, wpi::SmallVectorImpl< int64_t > &buf, std::span< const int64_t > defaultValue)
 
bool nt::SetFloatArray (NT_Handle pubentry, std::span< const float > value, int64_t time=0)
 Publish a new value. More...
 
bool nt::SetDefaultFloatArray (NT_Handle pubentry, std::span< const float > defaultValue)
 Publish a default value. More...
 
std::vector< float > nt::GetFloatArray (NT_Handle subentry, std::span< const float > defaultValue)
 Get the last published value. More...
 
TimestampedFloatArray nt::GetAtomicFloatArray (NT_Handle subentry, std::span< const float > defaultValue)
 Get the last published value along with its timestamp. More...
 
std::vector< TimestampedFloatArray > nt::ReadQueueFloatArray (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
std::vector< std::vector< float > > nt::ReadQueueValuesFloatArray (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
std::span< float > nt::GetFloatArray (NT_Handle subentry, wpi::SmallVectorImpl< float > &buf, std::span< const float > defaultValue)
 
TimestampedFloatArrayView nt::GetAtomicFloatArray (NT_Handle subentry, wpi::SmallVectorImpl< float > &buf, std::span< const float > defaultValue)
 
bool nt::SetDoubleArray (NT_Handle pubentry, std::span< const double > value, int64_t time=0)
 Publish a new value. More...
 
bool nt::SetDefaultDoubleArray (NT_Handle pubentry, std::span< const double > defaultValue)
 Publish a default value. More...
 
std::vector< double > nt::GetDoubleArray (NT_Handle subentry, std::span< const double > defaultValue)
 Get the last published value. More...
 
TimestampedDoubleArray nt::GetAtomicDoubleArray (NT_Handle subentry, std::span< const double > defaultValue)
 Get the last published value along with its timestamp. More...
 
std::vector< TimestampedDoubleArray > nt::ReadQueueDoubleArray (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
std::vector< std::vector< double > > nt::ReadQueueValuesDoubleArray (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
std::span< double > nt::GetDoubleArray (NT_Handle subentry, wpi::SmallVectorImpl< double > &buf, std::span< const double > defaultValue)
 
TimestampedDoubleArrayView nt::GetAtomicDoubleArray (NT_Handle subentry, wpi::SmallVectorImpl< double > &buf, std::span< const double > defaultValue)
 
bool nt::SetStringArray (NT_Handle pubentry, std::span< const std::string > value, int64_t time=0)
 Publish a new value. More...
 
bool nt::SetDefaultStringArray (NT_Handle pubentry, std::span< const std::string > defaultValue)
 Publish a default value. More...
 
std::vector< std::string > nt::GetStringArray (NT_Handle subentry, std::span< const std::string > defaultValue)
 Get the last published value. More...
 
TimestampedStringArray nt::GetAtomicStringArray (NT_Handle subentry, std::span< const std::string > defaultValue)
 Get the last published value along with its timestamp. More...
 
std::vector< TimestampedStringArray > nt::ReadQueueStringArray (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
std::vector< std::vector< std::string > > nt::ReadQueueValuesStringArray (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...