"Fossies" - the Fresh Open Source Software Archive 
Member "netxms-3.8.166/src/server/pdsdrv/rrdtool/rrdtool.cpp" (23 Feb 2021, 1949 Bytes) of package /linux/misc/netxms-3.8.166.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 "rrdtool.cpp" see the
Fossies "Dox" file reference documentation.
1 /*
2 ** NetXMS - Network Management System
3 ** Performance Data Storage Driver for RRDTools
4 ** Copyright (C) 2014 Raden Solutions
5 **
6 ** This program is free software; you can redistribute it and/or modify
7 ** it under the terms of the GNU Lesser General Public License as published by
8 ** the Free Software Foundation; either version 3 of the License, or
9 ** (at your option) any later version.
10 **
11 ** This program is distributed in the hope that it will be useful,
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ** GNU General Public License for more details.
15 **
16 ** You should have received a copy of the GNU Lesser General Public License
17 ** along with this program; if not, write to the Free Software
18 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 **
20 ** File: rrd.cpp
21 **/
22
23 #include <nms_core.h>
24 #include <pdsdrv.h>
25
26 /**
27 * Driver class definition
28 */
29 class RRDToolStorageDriver : public PerfDataStorageDriver
30 {
31 private:
32
33 public:
34 virtual const TCHAR *getName();
35
36 virtual bool saveDCItemValue(DCItem *dcObject, time_t timestamp, const TCHAR *value);
37 virtual bool saveDCTableValue(DCTable *dcObject, time_t timestamp, Table *value);
38 };
39
40 /**
41 * Driver name
42 */
43 static TCHAR *s_driverName = _T("RRDTOOL");
44
45 /**
46 * Get name
47 */
48 const TCHAR *RRDToolStorageDriver::getName()
49 {
50 return s_driverName;
51 }
52
53 /**
54 * Save DCI value
55 */
56 bool RRDToolStorageDriver::saveDCItemValue(DCItem *dcObject, time_t timestamp, const TCHAR *value)
57 {
58 _tprintf(_T("SAVE: %s %s\n\n"), dcObject->getName().cstr(), value);
59 return true;
60 }
61
62 /**
63 * Save table DCI value
64 */
65 bool RRDToolStorageDriver::saveDCTableValue(DCTable *dcObject, time_t timestamp, Table *value)
66 {
67 _tprintf(_T("SAVE TABLE: %s %d\n\n"), dcObject->getName().cstr(), value->getNumRows());
68 return true;
69 }
70
71 /**
72 * Driver entry point
73 */
74 DECLARE_PDSDRV_ENTRY_POINT(s_driverName, RRDToolStorageDriver);