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
17namespace Pulsar
18{
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>
69 {
70 return get_ext<T> (this, "Pulsar::Profile::get<Ext>", verbose);
71 }
72
73}
74
75#endif
Definition ProfileExtension.h:24
virtual std::string get_short_name() const
Return an abbreviated name that can be typed relatively quickly.
Definition Profile.C:217
std::string extension_name
Extension name - useful when debugging.
Definition ProfileExtension.h:51
virtual void integrate(const Profile *subint)
Integrate information from another Profile.
Definition ProfileExtension.h:40
std::string get_extension_name() const
Return the name of the Extension.
Definition Profile.C:212
Extension(const char *name)
Construct with a name.
Definition Profile.C:204
virtual TextInterface::Parser * get_interface()
Return a text interface that can be used to access this instance.
Definition ProfileExtension.h:37
virtual ~Extension()
Destructor.
Definition Profile.C:209
virtual Extension * clone() const =0
Return a new copy-constructed instance identical to this instance.
static bool verbose
flag controls the amount output to stderr by Profile methods
Definition Profile.h:48
const ExtensionType * get() const
Template method searches for an Extension of the specified type.
Profile(unsigned nbin=0)
Default constructor.
Definition Profile.C:84
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0