Lexis  1.1.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 
15 class Histogram;
16 typedef std::unique_ptr< const Histogram > ConstHistogramPtr;
17 
18 class Histogram : public ::zerobuf::Zerobuf
19 {
20 public:
21  typedef ::zerobuf::Vector< uint64_t > Bins;
28  Histogram::Bins& getBins();
29  const Histogram::Bins& getBins() const;
37  void setBins( uint64_t const * value, size_t size );
38  std::vector< uint64_t > getBinsVector() const;
45  void setBins( const std::vector< uint64_t >& value );
46 
47  float getMin() const;
54  void setMin( float value );
55 
56  float getMax() const;
63  void setMax( float value );
64 
65  void compact( float threshold = 0.1f ) final;
66  Histogram();
67  Histogram( const std::vector< uint64_t >& binsValue, const float& minValue, const float& maxValue );
68  Histogram( const Histogram& rhs );
69  Histogram( Histogram&& rhs ) noexcept;
70  Histogram( const ::zerobuf::Zerobuf& rhs );
71  explicit Histogram( ::zerobuf::AllocatorPtr allocator );
72  virtual ~Histogram();
73  Histogram& operator = ( const Histogram& rhs ) { ::zerobuf::Zerobuf::operator = ( rhs ); return *this; }
74  Histogram& operator = ( Histogram&& rhs );
75 
76  // Introspection
77  std::string getSchema() const final;
78  static std::string ZEROBUF_SCHEMA();
79  std::string getTypeName() const final { return "lexis::render::Histogram"; }
80  static std::string ZEROBUF_TYPE_NAME() { return "lexis::render::Histogram"; }
81  ::zerobuf::uint128_t getTypeIdentifier() const final { return ::zerobuf::uint128_t( 0x9dfdd89ba3575401ull, 0xeb19e84da1a445c6ull ); }
82  static ::zerobuf::uint128_t ZEROBUF_TYPE_IDENTIFIER() { return ::zerobuf::uint128_t( 0x9dfdd89ba3575401ull, 0xeb19e84da1a445c6ull ); }
83  size_t getZerobufStaticSize() const final { return 28; }
84  static size_t ZEROBUF_STATIC_SIZE() { return 28; }
85  size_t getZerobufNumDynamics() const final { return 1; }
86  static size_t ZEROBUF_NUM_DYNAMICS() { return 1; }
87  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 )))); }
88 
89  void _parseJSON( const Json::Value& json ) final;
90  void _createJSON( Json::Value& json ) const final;
91 
92 private:
93  Bins _bins;
94 };
95 
96 }
97 }
98 namespace zerobuf
99 {
100 }
101 
void setMax(float value)
Set the Max value.
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.