PSCF v1.2
rpg/fts/trajectory/TrajectoryReaderFactory.tpp
1#ifndef RPG_TRAJECTORY_READER_FACTORY_TPP
2#define RPG_TRAJECTORY_READER_FACTORY_TPP
3
4#include "TrajectoryReaderFactory.h"
5
6// Subclasses of ConfigIo
7#include "RGridTrajectoryReader.h"
8
9namespace Pscf {
10namespace Rpg {
11
12 using namespace Util;
13
14 /*
15 * Constructor
16 */
17 template <int D>
21
22 /*
23 * Return a pointer to a instance of TrajectoryReader subclass className.
24 */
25 template <int D>
27 TrajectoryReaderFactory<D>::factory(const std::string &className) const
28 {
29 TrajectoryReader<D> *ptr = 0;
30
31 // Try subfactories first
32 ptr = trySubfactories(className);
33 if (ptr) return ptr;
34
35 if (className == "RGridTrajectoryReader"
36 || className == "TrajectoryReader") {
37 ptr = new RGridTrajectoryReader<D>(*sysPtr_);
38 }
39 return ptr;
40 }
41
42}
43}
44#endif
Main class for calculations that represent one system.
Definition rpg/System.h:107
TrajectoryReader< D > * factory(const std::string &className) const
Method to create any TrajectoryReader supplied with PSCF.
PSCF package top-level namespace.
Definition param_pc.dox:1
Utility classes for scientific computation.