BinaryStatistic.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2020 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/More/General/BinaryStatistic.h
10
11#ifndef __BinaryStatistic_h
12#define __BinaryStatistic_h
13
14#include "Identifiable.h"
15
17class BinaryStatistic : public Identifiable
18{
19public:
20
22 static BinaryStatistic* factory (const std::string& name);
23
25 static const std::vector<BinaryStatistic*>& children ();
26
28 BinaryStatistic (const std::string& name, const std::string& description);
29
31
33 virtual double get (const std::vector<double>& data1,
34 const std::vector<double>& data2) = 0;
35
37 virtual BinaryStatistic* clone () const = 0;
38
40 void set_file (FILE* f) { fptr = f; }
41
42protected:
43
45 FILE* fptr;
46
47private:
48
50 static void build ();
51};
52
53#endif
54
virtual double get(const std::vector< double > &data1, const std::vector< double > &data2)=0
Derived types define the value returned.
virtual BinaryStatistic * clone() const =0
Derived types must also define clone method.
static const std::vector< BinaryStatistic * > & children()
Returns a list of available BinaryStatistic children.
Definition BinaryStatistic.C:165
FILE * fptr
The file to which auxiliary data will be printed.
Definition BinaryStatistic.h:45
BinaryStatistic(const std::string &name, const std::string &description)
Construct with a name and description.
Definition BinaryStatistic.C:122
static BinaryStatistic * factory(const std::string &name)
Create a new instance of BinaryStatistic based on name.
Definition BinaryStatistic.C:178
void set_file(FILE *f)
Set the file to which auxiliary data will be printed.
Definition BinaryStatistic.h:40

Generated using doxygen 1.14.0