11#ifndef __Pulsar_PlotFactory_h
12#define __Pulsar_PlotFactory_h
14#include "Pulsar/Plot.h"
51 std::vector<Reference::To<Agent>> agents;
55 template<
class P>
class Advocate;
58 void add (Agent* agent) { agents.push_back(agent); }
66 Agent (
char c, std::string n, std::string d)
67 : shortcut(c), name (n), description (d) {}
70 std::string get_name () {
return name; }
73 char get_shortcut () {
return shortcut; }
76 std::string get_description () {
return description; }
82 std::string description;
86 template<
class P>
class PlotFactory::Advocate :
public Agent
91 Advocate (std::string _name, std::string _description)
92 : Agent (
' ', _name, _description) {}
95 Advocate (
char shortcut, std::string _name, std::string _description)
96 : Agent (shortcut, _name, _description) {}
102 plot->set_constructor(
this);
PlotFactory()
Default constructor loads up all of the plot types.
Definition PlotFactory.C:51
~PlotFactory()
Destructor.
Definition PlotFactory.C:168
unsigned get_nplot()
Return the number of plots.
Definition PlotFactory.h:36
void add(Agent *agent)
Add a plot.
Definition PlotFactory.h:58
PlotFactory()
Default constructor loads up all of the plot types.
Definition PlotFactory.C:51
Plot * construct(std::string name)
Return a new instance of the named plot.
Definition PlotFactory.C:175
std::string help()
Return a descriptive list of the available plots.
Definition PlotFactory.C:202
std::string get_name(unsigned i)
Return the name of the ith plot.
Definition PlotFactory.C:191
std::string get_description(unsigned i)
Return the name of the ith plot.
Definition PlotFactory.C:197
virtual Plot * construct()=0
Return a new default constructed instance of a derived type.
Base class of all plotters.
Definition Plot.h:23
Defines the PSRCHIVE library.
Definition CalSource.h:17