8 #ifndef NTCORE_WIREENCODER_H_ 9 #define NTCORE_WIREENCODER_H_ 16 #include <llvm/SmallVector.h> 17 #include <llvm/StringRef.h> 19 #include "networktables/NetworkTableValue.h" 33 void set_proto_rev(
unsigned int proto_rev) { m_proto_rev = proto_rev; }
36 unsigned int proto_rev()
const {
return m_proto_rev; }
47 const char* error()
const {
return m_error; }
50 const char* data()
const {
return m_data.
data(); }
53 size_t size()
const {
return m_data.size(); }
60 void Write8(
unsigned int val) {
61 m_data.push_back(static_cast<char>(val & 0xff));
65 void Write16(
unsigned int val) {
67 {
static_cast<char>((val >> 8) & 0xff),
static_cast<char>(val & 0xff)});
71 void Write32(uint32_t val) {
72 m_data.
append({
static_cast<char>((val >> 24) & 0xff),
73 static_cast<char>((val >> 16) & 0xff),
74 static_cast<char>((val >> 8) & 0xff),
75 static_cast<char>(val & 0xff)});
79 void WriteDouble(
double val);
82 void WriteUleb128(uint32_t val);
84 void WriteType(NT_Type type);
85 void WriteValue(
const Value& value);
91 size_t GetValueSize(
const Value& value)
const;
100 unsigned int m_proto_rev;
111 #endif // NTCORE_WIREENCODER_H_ Definition: WireEncoder.h:28
Definition: IEntryNotifier.h:16
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
Definition: SmallVector.h:382
pointer data()
Return a pointer to the vector's buffer, even if empty().
Definition: SmallVector.h:134
A network table entry value.
Definition: NetworkTableValue.h:35
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:42