4 #include <zerobuf/ConstAllocator.h> 5 #include <zerobuf/Vector.h> 6 #include <zerobuf/Zerobuf.h> 16 typedef std::unique_ptr< const Stream > ConstStreamPtr;
18 class Stream :
public ::zerobuf::Zerobuf
21 typedef ::zerobuf::Vector< char > Host;
29 const Stream::Host&
getHost()
const;
37 void setHost(
char const * value,
size_t size );
38 std::string getHostString()
const;
45 void setHost(
const std::string& value );
47 typedef ::zerobuf::Vector< char > Id;
55 const Stream::Id&
getId()
const;
63 void setId(
char const * value,
size_t size );
64 std::string getIdString()
const;
71 void setId(
const std::string& value );
73 bool getEnabled()
const;
82 uint16_t getPort()
const;
91 bool getCompression()
const;
100 uint16_t getQuality()
const;
109 void compact(
float threshold = 0.1f )
final;
111 Stream(
const std::string& hostValue,
const bool& enabledValue,
const std::string& idValue,
const uint16_t& portValue,
const bool& compressionValue,
const uint16_t& qualityValue );
114 Stream( const ::zerobuf::Zerobuf& rhs );
115 explicit Stream( ::zerobuf::AllocatorPtr allocator );
117 Stream& operator = (
const Stream& rhs ) { ::zerobuf::Zerobuf::operator = ( rhs );
return *
this; }
121 std::string getSchema()
const final;
122 static std::string ZEROBUF_SCHEMA();
123 std::string getTypeName()
const final {
return "lexis::render::Stream"; }
124 static std::string ZEROBUF_TYPE_NAME() {
return "lexis::render::Stream"; }
125 ::zerobuf::uint128_t getTypeIdentifier()
const final { return ::zerobuf::uint128_t( 0x07310e6c2a2ca214ull, 0xe61f9c7a352b5417ull ); }
126 static ::zerobuf::uint128_t ZEROBUF_TYPE_IDENTIFIER() { return ::zerobuf::uint128_t( 0x07310e6c2a2ca214ull, 0xe61f9c7a352b5417ull ); }
127 size_t getZerobufStaticSize()
const final {
return 42; }
128 static size_t ZEROBUF_STATIC_SIZE() {
return 42; }
129 size_t getZerobufNumDynamics()
const final {
return 2; }
130 static size_t ZEROBUF_NUM_DYNAMICS() {
return 2; }
131 static ConstStreamPtr create(
const void* data,
const size_t size ) {
return ConstStreamPtr(
new Stream( ::zerobuf::AllocatorPtr( new ::zerobuf::ConstAllocator( reinterpret_cast< const uint8_t* >( data ), size )))); }
133 void _parseJSON(
const Json::Value& json )
final;
134 void _createJSON( Json::Value& json )
const final;
void setPort(uint16_t value)
Set the value of the uint16_t fixed size member.
void setCompression(bool value)
Set the value of the bool fixed size member.
void setQuality(uint16_t value)
Set the value of the uint16_t fixed size member.
void setHost(char const *value, size_t size)
Set the value of the char dynamic object from a char* and size.
Stream::Host & getHost()
Get a reference to the char dynamic member.
void setId(char const *value, size_t size)
Set the value of the char dynamic object from a char* and size.
Stream::Id & getId()
Get a reference to the char dynamic member.
void setEnabled(bool value)
Set the value of the bool fixed size member.