8 #ifndef NT_WIREENCODER_H_ 9 #define NT_WIREENCODER_H_ 14 #include "llvm/SmallVector.h" 15 #include "llvm/StringRef.h" 16 #include "networktables/NetworkTableValue.h" 30 void set_proto_rev(
unsigned int proto_rev) { m_proto_rev = proto_rev; }
33 unsigned int proto_rev()
const {
return m_proto_rev; }
44 const char* error()
const {
return m_error; }
47 const char* data()
const {
return m_data.
data(); }
50 std::size_t size()
const {
return m_data.size(); }
57 void Write8(
unsigned int val) { m_data.push_back((
char)(val & 0xff)); }
60 void Write16(
unsigned int val) {
61 m_data.
append({(char)((val >> 8) & 0xff), (char)(val & 0xff)});
65 void Write32(
unsigned long val) {
66 m_data.
append({(char)((val >> 24) & 0xff), (char)((val >> 16) & 0xff),
67 (
char)((val >> 8) & 0xff), (char)(val & 0xff)});
71 void WriteDouble(
double val);
74 void WriteUleb128(
unsigned long val);
76 void WriteType(NT_Type type);
77 void WriteValue(
const Value& value);
83 std::size_t GetValueSize(
const Value& value)
const;
92 unsigned int m_proto_rev;
103 #endif // NT_WIREENCODER_H_ Definition: WireEncoder.h:25
Definition: IEntryNotifier.h:15
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:30
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:42