1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 2009, 2011 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17 #ifndef OUTPUT_CHARTS_ROC_CHART_H
18 #define OUTPUT_CHARTS_ROC_CHART_H 1
22 #include "output/chart-item.h"
26 struct chart_item chart_item;
30 size_t allocated_vars;
36 struct casereader *cutpoint_reader;
39 struct roc_chart *roc_chart_create (bool reference);
40 void roc_chart_add_var (struct roc_chart *, const char *var_name,
41 const struct casereader *cutpoint_reader);
43 /* This boilerplate for roc_chart, a subclass of chart_item, was
44 autogenerated by mk-class-boilerplate. */
47 #include "libpspp/cast.h"
49 extern const struct chart_item_class roc_chart_class;
51 /* Returns true if SUPER is a roc_chart, otherwise false. */
53 is_roc_chart (const struct chart_item *super)
55 return super->class == &roc_chart_class;
58 /* Returns SUPER converted to roc_chart. SUPER must be a roc_chart, as
59 reported by is_roc_chart. */
60 static inline struct roc_chart *
61 to_roc_chart (const struct chart_item *super)
63 assert (is_roc_chart (super));
64 return UP_CAST (super, struct roc_chart, chart_item);
67 /* Returns INSTANCE converted to chart_item. */
68 static inline struct chart_item *
69 roc_chart_super (const struct roc_chart *instance)
71 return CONST_CAST (struct chart_item *, &instance->chart_item);
74 /* Increments INSTANCE's reference count and returns INSTANCE. */
75 static inline struct roc_chart *
76 roc_chart_ref (const struct roc_chart *instance)
78 return to_roc_chart (chart_item_ref (&instance->chart_item));
81 /* Decrements INSTANCE's reference count, then destroys INSTANCE if
82 the reference count is now zero. */
84 roc_chart_unref (struct roc_chart *instance)
86 chart_item_unref (&instance->chart_item);
89 /* Returns true if INSTANCE's reference count is greater than 1,
92 roc_chart_is_shared (const struct roc_chart *instance)
94 return chart_item_is_shared (&instance->chart_item);
98 roc_chart_submit (struct roc_chart *instance)
100 chart_item_submit (&instance->chart_item);
103 #endif /* output/charts/roc-chart.h */