ProfileExtension.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2008 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/Base/Classes/Pulsar/ProfileExtension.h
10 
11 #ifndef __Pulsar_Profile_Extension_h
12 #define __Pulsar_Profile_Extension_h
13 
14 #include "Pulsar/Profile.h"
15 #include "extutil.h"
16 
17 namespace Pulsar
18 {
23  class Profile::Extension : public Reference::Able
24  {
25  public:
26 
28  Extension (const char* name);
29 
31  virtual ~Extension ();
32 
34  virtual Extension* clone () const = 0;
35 
37  virtual TextInterface::Parser* get_interface () { return 0; }
38 
40  virtual void integrate (const Profile* subint) { }
41 
43  std::string get_extension_name () const;
44 
46  virtual std::string get_short_name () const;
47 
48  protected:
49 
51  std::string extension_name;
52 
53  };
54 
58  template<class T>
59  const T* Profile::get () const
60  {
61  return get_ext<const T> (this, "Pulsar::Profile::get<Ext>", verbose);
62  }
63 
67  template<class T>
68  T* Profile::get ()
69  {
70  return get_ext<T> (this, "Pulsar::Profile::get<Ext>", verbose);
71  }
72 
73 }
74 
75 #endif
virtual ~Extension()
Destructor.
Definition: Profile.C:209
Definition: ProfileExtension.h:28
Any quantity recorded as a function of pulse phase.
Definition: Profile.h:45
std::string extension_name
Extension name - useful when debugging.
Definition: ProfileExtension.h:61
virtual TextInterface::Parser * get_interface()
Return a text interface that can be used to access this instance.
Definition: ProfileExtension.h:47
static bool verbose
flag controls the amount output to stderr by Profile methods
Definition: Profile.h:53
std::string get_extension_name() const
Return the name of the Extension.
Definition: Profile.C:212
virtual void integrate(const Profile *subint)
Integrate information from another Profile.
Definition: ProfileExtension.h:50
Defines the PSRCHIVE library.
Definition: CalSource.h:17
const ExtensionType * get() const
Template method searches for an Extension of the specified type.
virtual Extension * clone() const =0
Return a new copy-constructed instance identical to this instance.
Extension(const char *name)
Construct with a name.
Definition: Profile.C:204
virtual std::string get_short_name() const
Return an abbreviated name that can be typed relatively quickly.
Definition: Profile.C:217

Generated using doxygen 1.8.17