Lexis  1.2.0
Vocabulary of events and shared objects for BBP and HBP software
histogram.h
1 // Generated by zerobufCxx.py
2 
3 #pragma once
4 #include <zerobuf/ConstAllocator.h> // static create
5 #include <zerobuf/Vector.h> // member
6 #include <zerobuf/Zerobuf.h> // base class
7 #include <array> // member
8 #include <memory> // std::unique_ptr
9 
10 namespace lexis
11 {
12 namespace render
13 {
14 namespace detail
15 {
16 
17 class Histogram;
18 typedef std::unique_ptr< const Histogram > ConstHistogramPtr;
19 
20 class Histogram : public ::zerobuf::Zerobuf
21 {
22 public:
23  typedef ::zerobuf::Vector< uint64_t > Bins;
30  Histogram::Bins& getBins();
31  const Histogram::Bins& getBins() const;
39  void setBins( uint64_t const * value, size_t size );
40  std::vector< uint64_t > getBinsVector() const;
47  void setBins( const std::vector< uint64_t >& value );
48 
49  float getMin() const;
56  void setMin( float value );
57 
58  float getMax() const;
65  void setMax( float value );
66 
67  void compact( float threshold = 0.1f ) final;
68  Histogram();
69  Histogram( const std::vector< uint64_t >& binsValue, const float& minValue, const float& maxValue );
70  Histogram( const Histogram& rhs );
71  Histogram( Histogram&& rhs ) noexcept;
72  Histogram( const ::zerobuf::Zerobuf& rhs );
73  explicit Histogram( ::zerobuf::AllocatorPtr allocator );
74  virtual ~Histogram();
75  Histogram& operator = ( const Histogram& rhs ) { ::zerobuf::Zerobuf::operator = ( rhs ); return *this; }
76  Histogram& operator = ( Histogram&& rhs );
77 
78  // Introspection
79  std::string getSchema() const final;
80  static std::string ZEROBUF_SCHEMA();
81  std::string getTypeName() const final { return "lexis::render::detail::Histogram"; }
82  static std::string ZEROBUF_TYPE_NAME() { return "lexis::render::detail::Histogram"; }
83  ::zerobuf::uint128_t getTypeIdentifier() const final { return ::zerobuf::uint128_t( 0x5d232cba6e8e0ec9ull, 0xbd767de633a5ac6dull ); }
84  static ::zerobuf::uint128_t ZEROBUF_TYPE_IDENTIFIER() { return ::zerobuf::uint128_t( 0x5d232cba6e8e0ec9ull, 0xbd767de633a5ac6dull ); }
85  size_t getZerobufStaticSize() const final { return 28; }
86  static size_t ZEROBUF_STATIC_SIZE() { return 28; }
87  size_t getZerobufNumDynamics() const final { return 1; }
88  static size_t ZEROBUF_NUM_DYNAMICS() { return 1; }
89  static ConstHistogramPtr create( const void* data, const size_t size ) { return ConstHistogramPtr( new Histogram( ::zerobuf::AllocatorPtr( new ::zerobuf::ConstAllocator( reinterpret_cast< const uint8_t* >( data ), size )))); }
90 
91  void _parseJSON( const Json::Value& json ) final;
92  void _createJSON( Json::Value& json ) const final;
93 
94 private:
95  Bins _bins;
96 };
97 
98 }
99 }
100 }
101 namespace zerobuf
102 {
103 }
104 
void setBins(uint64_t const *value, size_t size)
Set the value of the Bins dynamic object from a uint64_t* and size.
Histogram::Bins & getBins()
Get a reference to the Bins dynamic member.
void setMin(float value)
Set the Min value.
void setMax(float value)
Set the Max value.