9
enum EmphasisLevel { elLOW=0, elMEDIUM=1, elHIGH=2 };
11
class CCCC_Html_Stream;
13
// the single class CCCC_Metric which will be defined later in this file
14
// will be used for all metrics
15
// differences in output formats will be handled by giving each object
16
// of type CCCC_Metric a pointer to a an object of type Metric_Treatment
17
// which will be held in a global array called Metric_Treatment_Table
18
class Metric_Treatment
20
friend class CCCC_Metric;
21
friend void add_treatment(CCCC_Item&);
22
friend CCCC_Html_Stream& operator <<(CCCC_Html_Stream&,const CCCC_Metric&);
24
// a short code string is used to search for the metric treatment, and
28
// lower_threshold and upper_threshold are the levels at which the metric
29
// is interpreted as moving between low, medium and high emphasis levels
30
float lower_threshold, upper_threshold;
32
// for ratio type metrics, we provide the facility for screening out of
33
// items for which the numerator lies below a given value
34
// e.g. we may impose a standard of 1 line of comment per 3 of code, but
35
// say that we do not require this standard to apply to routines shorter
37
int numerator_threshold;
39
// preferred display width and number of decimal places
43
Metric_Treatment(CCCC_Item& treatment_line);
45
friend class CCCC_Options;
48
// the main metric class
50
Metric_Treatment* treatment;
51
float numerator, denominator;
52
friend CCCC_Metric& operator+(const CCCC_Metric&, const CCCC_Metric&);
55
CCCC_Metric(int n, const char* treatment_tag="");
56
CCCC_Metric(int n, int d, const char* treatment_tag="");
57
void set_treatment(const char* code);
58
void set_ratio(float _num, float _denom=1.0);
59
EmphasisLevel emphasis_level() const;
62
string value_string() const;
67
#endif /* __CCCC_MET_H */