Parameters.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2007 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/Util/tempo/Pulsar/Parameters.h
10 
11 #ifndef __PulsarParameters_h
12 #define __PulsarParameters_h
13 
14 #include "Reference.h"
15 
16 #include <stdio.h>
17 
18 namespace Pulsar {
19 
21 
23  class Parameters : public Reference::Able {
24 
25  public:
26 
28  static bool verbose;
29 
30  class Lookup;
31 
33  static void children (std::vector< Reference::To<Parameters> >&);
34 
36  virtual Parameters* clone () const = 0;
37 
39  virtual bool equals (const Parameters* that) const = 0;
40 
42  virtual void load (FILE*) = 0;
43 
45  virtual void unload (FILE*) const = 0;
46 
48  void load (const std::string& filename);
49 
51  void unload (const std::string& filename) const;
52 
54  virtual std::string get_name () const;
55 
57  virtual std::string get_value (const std::string& keyword) const;
58  };
59 
60 }
61 
62 #endif
@ Pulsar
A pulsar.
Definition: Types.h:63
A convenient exception handling class.
Definition: Error.h:54
virtual std::string get_value(const std::string &keyword) const
Retrieve a string from the text.
Definition: Parameters.C:41
Looks for pulsar parameters in various places.
Definition: ParametersLookup.h:24
Template class manages Reference::Able objects.
Definition: Reference.h:74
static void children(std::vector< Reference::To< Parameters > > &)
Factory helper creates a vector of pointers to derived class instances.
Definition: Parameters_children.C:17
static bool verbose
Verbosity flag.
Definition: Parameters.h:38
Manages Reference::To references to the instance.
Definition: ReferenceAble.h:40
virtual bool equals(const Parameters *that) const =0
Return true if *this == *that.
Closes a FILE* when it goes out of scope.
Definition: FilePtr.h:18
virtual void unload(FILE *) const =0
Unload to an open stream.
virtual Parameters * clone() const =0
Return a new, copy constructed instance of self.
virtual std::string get_name() const
Return the pulsar name.
Definition: Parameters.C:34
virtual void load(FILE *)=0
Load from an open stream.
Storage of pulsar parameters used to create a Predictor.
Definition: Parameters.h:28

Generated using doxygen 1.8.17