Fawkes API  Fawkes Development Version
rrd_manager.h
1 
2 /***************************************************************************
3  * rrd_manager.h - Fawkes RRD manager interface
4  *
5  * Created: Fri Dec 17 00:28:14 2010
6  * Copyright 2006-2010 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef __PLUGINS_RRD_ASPECT_RRD_MANAGER_H_
25 #define __PLUGINS_RRD_ASPECT_RRD_MANAGER_H_
26 
27 #include <plugins/rrd/aspect/rrd_descriptions.h>
28 #include <core/utils/rwlock_vector.h>
29 
30 namespace fawkes {
31 #if 0 /* just to make Emacs auto-indent happy */
32 }
33 #endif
34 
35 
36 /** @class RRDManager <plugins/rrd/aspect/rrd_manager.h>
37  * Interface for a RRD connection creator.
38  * @author Tim Niemueller
39  */
41 {
42  public:
43  /** Virtual empty destructor. */
44  virtual ~RRDManager() {}
45 
46  /** Add RRD.
47  * Add an RRD which can then be fed with data using add_data().
48  * @param rrd_def RRD definition
49  */
50  virtual void add_rrd(RRDDefinition *rrd_def) = 0;
51 
52  /** Remove RRD.
53  * Remove a RRD definition. This also removes all associated graphs.
54  * @param rrd_def RRD definition
55  */
56  virtual void remove_rrd(RRDDefinition *rrd_def) = 0;
57 
58  /** Add graph.
59  * Add a graph definition from which to generate graphs.
60  * @param rrd_graph_def RRD graph definition
61  */
62  virtual void add_graph(RRDGraphDefinition *rrd_graph_def) = 0;
63 
64  /** Add data.
65  * Add data to an RRF.
66  * @param rrd_name name of the RRD to add data to
67  * @param format format string. It must have the form TIMESTAMP|N:DATA,
68  * where TIMESTAMP|N is either a timestamp (in seconds since the epoch), or
69  * the letter N to use the current time. DATA is a concatenation of formats
70  * according to man sprintf and concatenated by colons, e.g. 1:2:3:4.5.
71  */
72  virtual void add_data(const char *rrd_name, const char *format, ...) = 0;
73 
74  /** Get RRDs.
75  * @return vector of all current RRD definitions.
76  */
77  virtual const RWLockVector<RRDDefinition *> & get_rrds() const = 0;
78 
79  /** Get graphs.
80  * @return vector of all current graph definitions.
81  */
82  virtual const RWLockVector<RRDGraphDefinition *> & get_graphs() const = 0;
83 
84 };
85 
86 } // end namespace fawkes
87 
88 #endif
virtual const RWLockVector< RRDDefinition * > & get_rrds() const =0
Get RRDs.
virtual void add_rrd(RRDDefinition *rrd_def)=0
Add RRD.
Interface for a RRD connection creator.
Definition: rrd_manager.h:40
Fawkes library namespace.
virtual void add_graph(RRDGraphDefinition *rrd_graph_def)=0
Add graph.
virtual void add_data(const char *rrd_name, const char *format,...)=0
Add data.
Class representing a graph definition.
virtual void remove_rrd(RRDDefinition *rrd_def)=0
Remove RRD.
virtual const RWLockVector< RRDGraphDefinition * > & get_graphs() const =0
Get graphs.
virtual ~RRDManager()
Virtual empty destructor.
Definition: rrd_manager.h:44
Vector with a lock.
Definition: rwlock_vector.h:37