Fawkes API  Fawkes Development Version
fawkes::RRDGraphDefinition Class Reference

Class representing a graph definition. More...

#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...
 
const unsigned int get_update_interval () const
 Get update interval. More...
 
const 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 313 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 817 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 848 of file rrd_descriptions.cpp.

References fawkes::StringConversions::to_string().

◆ ~RRDGraphDefinition()

fawkes::RRDGraphDefinition::~RRDGraphDefinition ( )

Destructor.

Definition at line 873 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 914 of file rrd_descriptions.cpp.

◆ get_defs()

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

Get definitions.

Returns
definitions

Definition at line 348 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 350 of file rrd_descriptions.h.

◆ get_end()

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

Get end time.

Returns
end time

Definition at line 336 of file rrd_descriptions.h.

◆ get_filename()

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

Get filename.

Returns
filename

Definition at line 357 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 355 of file rrd_descriptions.h.

◆ get_name()

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

Get graph definition name.

Returns
graph definition name

Definition at line 330 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 332 of file rrd_descriptions.h.

◆ get_slope_mode()

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

Get slope moe.

Returns
slope mode

Definition at line 346 of file rrd_descriptions.h.

◆ get_start()

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

Get start time.

Returns
start time

Definition at line 334 of file rrd_descriptions.h.

◆ get_step()

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

Get step size.

Returns
step size

Definition at line 338 of file rrd_descriptions.h.

◆ get_title()

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

Get title.

Returns
tile

Definition at line 340 of file rrd_descriptions.h.

◆ get_update_interval()

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

Get update interval.

Returns
update interval

Definition at line 344 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 342 of file rrd_descriptions.h.

◆ get_width()

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

Get line width.

Returns
line width.

Definition at line 353 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 899 of file rrd_descriptions.cpp.

References fawkes::RRDDefinition::get_name().

Referenced by RRDThread::add_graph().


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