ArchiveStatistic.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/Pulsar/ArchiveStatistic.h
10
11#ifndef __ArchiveStatistic_h
12#define __ArchiveStatistic_h
13
14#include "Pulsar/HasArchive.h"
15#include "Identifiable.h"
16#include "TextInterface.h"
17
18namespace Pulsar {
19
21
23
24 class ArchiveStatistic : public Identifiable, public HasArchive
25 {
26 protected:
27
29
31
33 FILE* fptr;
34
35 public:
36
38 static ArchiveStatistic* factory (const std::string& name);
39
41 ArchiveStatistic (const std::string& name,
42 const std::string& description);
43
45 virtual double get () = 0;
46
49
51 virtual ArchiveStatistic* clone () const = 0;
52
54 virtual void set_file (FILE* f) { fptr = f; }
55
57 virtual void fclose ();
58 };
59
60 std::ostream& operator<< (std::ostream&, ArchiveStatistic*);
61
62 std::istream& operator>> (std::istream&, ArchiveStatistic*&);
63
64}
65
66#endif
67
ArchiveStatistic()
Construct without a name and description.
Definition ArchiveStatistic.C:70
virtual double get()=0
Derived types define the value returned.
virtual void set_file(FILE *f)
Set the file to which auxiliary data will be printed.
Definition ArchiveStatistic.h:54
FILE * fptr
File to which auxiliary data will be printed.
Definition ArchiveStatistic.h:33
static ArchiveStatistic * factory(const std::string &name)
Create a new instance of ArchiveStatistic based on name.
Definition ArchiveStatistic.C:127
virtual TextInterface::Parser * get_interface()=0
Return a text interface that can be used to configure this instance.
virtual ArchiveStatistic * clone() const =0
Derived types must also define clone method.
virtual void fclose()
Close the file to which auxiliary data were printed.
Definition ArchiveStatistic.C:86
HasArchive()
Default constructor.
Definition HasArchive.C:19
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0