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 
18 namespace Pulsar {
19 
21 
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 
48  virtual TextInterface::Parser* get_interface () = 0;
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 
static ArchiveStatistic * factory(const std::string &name)
Create a new instance of ArchiveStatistic based on name.
Definition: ArchiveStatistic.C:124
virtual void fclose()
Close the file to which auxiliary data were printed.
Definition: ArchiveStatistic.C:83
virtual TextInterface::Parser * get_interface()=0
Return a text interface that can be used to configure this instance.
Type * get() const
Commmon statistics that can be derived from an Archive.
Definition: ArchiveStatistic.h:29
Commmon statistics that can be derived from a pulse profile.
Definition: ProfileStatistic.h:26
virtual double get()=0
Derived types define the value returned.
virtual ArchiveStatistic * clone() const =0
Derived types must also define clone method.
Defines the PSRCHIVE library.
Definition: CalSource.h:17
const Profile * get_Profile(const Archive *data, Index subint, Index pol, Index chan)
Return the requested profile, cloning and integrating when needed.
Definition: Index.C:24
virtual void set_file(FILE *f)
Set the file to which auxiliary data will be printed.
Definition: ArchiveStatistic.h:64
FILE * fptr
File to which auxiliary data will be printed.
Definition: ArchiveStatistic.h:43
ArchiveStatistic()
Construct without a name and description.
Definition: ArchiveStatistic.C:67
static const std::vector< BinaryStatistic * > & children()

Generated using doxygen 1.8.17