21 #ifndef INCLUDE_OLA_IO_INPUTSTREAM_H_ 22 #define INCLUDE_OLA_IO_INPUTSTREAM_H_ 26 #include <ola/io/InputBuffer.h> 43 virtual bool operator>>(int8_t &val) = 0;
44 virtual bool operator>>(uint8_t &val) = 0;
45 virtual bool operator>>(int16_t &val) = 0;
46 virtual bool operator>>(uint16_t &val) = 0;
47 virtual bool operator>>(int32_t &val) = 0;
48 virtual bool operator>>(uint32_t &val) = 0;
54 virtual unsigned int ReadString(std::string *output,
unsigned int size) = 0;
70 bool operator>>(int8_t &val) {
return Extract(&val); }
71 bool operator>>(uint8_t &val) {
return Extract(&val); }
72 bool operator>>(int16_t &val) {
return Extract(&val); }
73 bool operator>>(uint16_t &val) {
return Extract(&val); }
74 bool operator>>(int32_t &val) {
return Extract(&val); }
75 bool operator>>(uint32_t &val) {
return Extract(&val); }
77 unsigned int ReadString(std::string *output,
unsigned int size) {
78 return m_buffer->Read(output, size);
85 bool Extract(T *val) {
86 unsigned int length = m_buffer->
Read(reinterpret_cast<uint8_t*>(val),
88 return length ==
sizeof(*val);
95 #endif // INCLUDE_OLA_IO_INPUTSTREAM_H_
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Creates dummy copy constructor and assignment operator declarations.
Definition: Macro.h:44
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44