Fawkes API  Fawkes Development Version
fawkes::RRDGraphDefinition Class Reference

#include <>>

Public Member Functions

 RRDGraphDefinition (const char *name, RRDDefinition *rrd_def, const char *title, const char *vertical_label, std::vector< RRDGraphDataDefinition > &def, std::vector< RRDGraphElement * > &elements, time_t start=-600, time_t end=-10, unsigned int step=10, unsigned int update_interval=10, bool slope_mode=false)
 Constructor. More...
 
 RRDGraphDefinition (const RRDGraphDefinition &other)
 Copy constructor. More...
 
 ~RRDGraphDefinition ()
 Destructor. More...
 
void set_filename (const char *filename)
 Set filename. More...
 
const char ** get_argv (size_t &argc) const
 Get argument array and size. More...
 
const char * get_name () const
 Get graph definition name. More...
 
const RRDDefinitionget_rrd_def () const
 Get RRD definition. More...
 
time_t get_start () const
 Get start time. More...
 
time_t get_end () const
 Get end time. More...
 
unsigned int get_step () const
 Get step size. More...
 
const char * get_title () const
 Get title. More...
 
const char * get_vertical_label () const
 Get vertical label. More...
 
unsigned int get_update_interval () const
 Get update interval. More...
 
bool get_slope_mode () const
 Get slope moe. More...
 
const std::vector< RRDGraphDataDefinition > & get_defs () const
 Get definitions. More...
 
const std::vector< RRDGraphElement * > & get_elements () const
 Get graph elements. More...
 
unsigned int get_width () const
 Get line width. More...
 
const std::vector< const char * > get_fonts () const
 Get fonts. More...
 
const char * get_filename () const
 Get filename. More...
 

Detailed Description

Class representing a graph definition. This graph definition is used to generate all required parameters to create a graph from an RRD.

Author
Tim Niemueller

Definition at line 470 of file rrd_descriptions.h.

Constructor & Destructor Documentation

◆ RRDGraphDefinition() [1/2]

fawkes::RRDGraphDefinition::RRDGraphDefinition ( const char *  name,
RRDDefinition rrd_def,
const char *  title,
const char *  vertical_label,
std::vector< RRDGraphDataDefinition > &  def,
std::vector< RRDGraphElement * > &  elements,
time_t  start = -600,
time_t  end = -10,
unsigned int  step = 10,
unsigned int  update_interval = 10,
bool  slope_mode = false 
)

Constructor.

Parameters
namename of this graph definition, used internally, name must be unique among all registered graphs.
rrd_defpointer to definition of the RRD to graph
starttime from where to start graphing. Maybe an absolute time or a negative number for relative times, e.g. "-300" for 5 minutes back from now.
endtime where to end graphing. Maybe an absolute time or a negative number for relative times, e.g. "-300" for 5 minutes back from now.
stepstep size in seconds
titleGraph title to print on top of graph
vertical_labelstring printed rotated by 90° counter-clockwise besides the vertical axis. Usually should carry description of the Y axis units.
update_intervalThe interval at which the graph should be generated.
slope_modetrue to enable slope mode when graphing
defdata definitions for the graph
elementselements to print in the graph. This graph definition takes ownership of the graph elemenets and will delete them in its dtor.

Definition at line 903 of file rrd_descriptions.cpp.

References fawkes::StringConversions::to_string().

◆ RRDGraphDefinition() [2/2]

fawkes::RRDGraphDefinition::RRDGraphDefinition ( const RRDGraphDefinition other)

Copy constructor.

Parameters
otherinstance to copy

Definition at line 943 of file rrd_descriptions.cpp.

References fawkes::StringConversions::to_string().

◆ ~RRDGraphDefinition()

fawkes::RRDGraphDefinition::~RRDGraphDefinition ( )

Destructor.

Definition at line 972 of file rrd_descriptions.cpp.

Member Function Documentation

◆ get_argv()

const char ** fawkes::RRDGraphDefinition::get_argv ( size_t &  argc) const

Get argument array and size.

Parameters
argcupon completion contains the number of arguments in the return value.
Returns
argument array suitable for rrd_create_v().

Definition at line 1018 of file rrd_descriptions.cpp.

◆ get_defs()

const std::vector<RRDGraphDataDefinition>& fawkes::RRDGraphDefinition::get_defs ( ) const
inline

Get definitions.

Returns
definitions

Definition at line 546 of file rrd_descriptions.h.

◆ get_elements()

const std::vector<RRDGraphElement *>& fawkes::RRDGraphDefinition::get_elements ( ) const
inline

Get graph elements.

Returns
graph elements

Definition at line 552 of file rrd_descriptions.h.

◆ get_end()

time_t fawkes::RRDGraphDefinition::get_end ( ) const
inline

Get end time.

Returns
end time

Definition at line 510 of file rrd_descriptions.h.

◆ get_filename()

const char* fawkes::RRDGraphDefinition::get_filename ( ) const
inline

Get filename.

Returns
filename

Definition at line 570 of file rrd_descriptions.h.

◆ get_fonts()

const std::vector<const char *> fawkes::RRDGraphDefinition::get_fonts ( ) const
inline

Get fonts.

Returns
fonts

Definition at line 564 of file rrd_descriptions.h.

◆ get_name()

const char* fawkes::RRDGraphDefinition::get_name ( ) const
inline

Get graph definition name.

Returns
graph definition name

Definition at line 492 of file rrd_descriptions.h.

Referenced by RRDThread::add_graph().

◆ get_rrd_def()

const RRDDefinition* fawkes::RRDGraphDefinition::get_rrd_def ( ) const
inline

Get RRD definition.

Returns
RRD definition

Definition at line 498 of file rrd_descriptions.h.

◆ get_slope_mode()

bool fawkes::RRDGraphDefinition::get_slope_mode ( ) const
inline

Get slope moe.

Returns
slope mode

Definition at line 540 of file rrd_descriptions.h.

◆ get_start()

time_t fawkes::RRDGraphDefinition::get_start ( ) const
inline

Get start time.

Returns
start time

Definition at line 504 of file rrd_descriptions.h.

◆ get_step()

unsigned int fawkes::RRDGraphDefinition::get_step ( ) const
inline

Get step size.

Returns
step size

Definition at line 516 of file rrd_descriptions.h.

◆ get_title()

const char* fawkes::RRDGraphDefinition::get_title ( ) const
inline

Get title.

Returns
tile

Definition at line 522 of file rrd_descriptions.h.

◆ get_update_interval()

unsigned int fawkes::RRDGraphDefinition::get_update_interval ( ) const
inline

Get update interval.

Returns
update interval

Definition at line 534 of file rrd_descriptions.h.

◆ get_vertical_label()

const char* fawkes::RRDGraphDefinition::get_vertical_label ( ) const
inline

Get vertical label.

Returns
vertical label

Definition at line 528 of file rrd_descriptions.h.

◆ get_width()

unsigned int fawkes::RRDGraphDefinition::get_width ( ) const
inline

Get line width.

Returns
line width.

Definition at line 558 of file rrd_descriptions.h.

◆ set_filename()

void fawkes::RRDGraphDefinition::set_filename ( const char *  filename)

Set filename.

This can be done only once. Do not do this manually, rather let the RRDManager handle this!

Parameters
filenamenew filename, should be absolute, otherwise considered relative to current working directory.

Definition at line 1003 of file rrd_descriptions.cpp.

Referenced by RRDThread::add_graph().


The documentation for this class was generated from the following files: