"Fossies" - the Fresh Open Source Software Archive

Member "tcpflow-1.6.1/src/netviz/address_histogram_view.h" (19 Feb 2021, 1355 Bytes) of package /linux/misc/tcpflow-1.6.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "address_histogram_view.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * This source file is public domain, as it is not based on the original tcpflow.
    3  *
    4  * Author: Michael Shick <mike@shick.in>
    5  */
    6 
    7 
    8 #ifndef ADDRESS_HISTOGRAM_VIEW_H
    9 #define ADDRESS_HISTOGRAM_VIEW_H
   10 
   11 #include "config.h"
   12 #ifdef HAVE_LIBCAIRO
   13 
   14 #include "plot_view.h"
   15 #include "address_histogram.h"
   16 
   17 class address_histogram_view : public plot_view {
   18 public:
   19     address_histogram_view(const address_histogram &histogram_);
   20 
   21     class bucket_view {
   22     public:
   23         bucket_view(const iptree::addr_elem &bucket_,
   24                 const rgb_t &color_) :
   25             bucket(bucket_), color(color_) {}
   26 
   27         const iptree::addr_elem &bucket;
   28         const rgb_t &color;
   29 
   30         static const double label_font_size;
   31 
   32         void render(cairo_t *cr, const bounds_t &bounds);
   33         void render_label(cairo_t *cr, const bounds_t &bounds);
   34     };
   35 
   36     const address_histogram &histogram;
   37     rgb_t bar_color;
   38     rgb_t cdf_color;
   39 
   40     static const double bar_space_factor;
   41     static const size_t compressed_ip6_str_max_len;
   42     static const double cdf_line_width;
   43     static const double data_width_factor;
   44 
   45     void render(cairo_t *cr, const bounds_t &bounds);
   46     void render_data(cairo_t *cr, const bounds_t &bounds);
   47     const address_histogram &get_data() const;
   48 
   49     static std::string compressed_ip6_str(iptree::addr_elem address);
   50 };
   51 
   52 #endif
   53 #endif