11 #ifndef __Pulsar_PlotFactory_h
12 #define __Pulsar_PlotFactory_h
14 #include "Pulsar/Plot.h"
33 unsigned get_nplot () { return agents.size(); }
48 std::vector<Agent*> agents;
52 template< class P> class Advocate;
55 void add (Agent* agent) { agents.push_back(agent); }
59 class PlotFactory::Agent : public Plot::Constructor
63 Agent ( char c, std::string n, std::string d)
64 : shortcut(c), name (n), description (d) {}
67 std::string get_name () { return name; }
70 char get_shortcut () { return shortcut; }
79 std::string description;
83 template< class P> class PlotFactory::Advocate : public Agent
88 Advocate (std::string _name, std::string _description)
89 : Agent ( ' ', _name, _description) {}
92 Advocate ( char shortcut, std::string _name, std::string _description)
93 : Agent (shortcut, _name, _description) {}
99 plot->set_constructor( this);
PlotFactory() Default constructor loads up all of the plot types. Definition: PlotFactory.C:51
void add(Agent *agent) Add a plot. Definition: PlotFactory.h:65
std::string get_name(unsigned i) Return the name of the ith plot. Definition: PlotFactory.C:185
std::string get_description(unsigned i) Return the name of the ith plot. Definition: PlotFactory.C:191
Plot * construct(std::string name) Return a new instance of the named plot. Definition: PlotFactory.C:169
Defines the PSRCHIVE library. Definition: CalSource.h:17
unsigned get_nplot() Return the number of plots. Definition: PlotFactory.h:43
Base class of all plotters. Definition: Plot.h:28
std::string help() Return a descriptive list of the available plots. Definition: PlotFactory.C:196
Generated using doxygen 1.8.17
|