00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "DataSource/MakeDataSource.h"
00028 #include "DataSource/DataSourceObject.h"
00029 #include "DataSource/DataConnect.h"
00030 #include "Utility/Pstring.h"
00031 #include "Profile/Profiler.h"
00032
00033
00034
00035
00036
00037
00038 #include "DataSource/FileFieldDataSource.h"
00039 #include "DataSource/FilePtclBaseDataSource.h"
00040 #include "DataSource/FilePtclAttribDataSource.h"
00041
00042
00043 #ifdef IPPL_ACLVIS
00044 #include "DataSource/ACLVISFieldDataSource.h"
00045 #include "DataSource/ACLVISPtclBaseDataSource.h"
00046 #include "DataSource/ACLVISPtclAttribDataSource.h"
00047 #endif
00048
00049
00050 #ifdef IPPL_PAWS
00051 #include "IpplPaws/PawsFieldDataSource.h"
00052 #include "IpplPaws/PawsPtclAttribDataSource.h"
00053 #include "IpplPaws/PawsScalarDataSource.h"
00054 #include "IpplPaws/PawsStringDataSource.h"
00055 #endif
00056
00057
00059
00060
00061 template<class T, unsigned Dim, class M, class C>
00062 DataSourceObject *
00063 make_DataSourceObject(const char *nm, DataConnect *dc, int t,
00064 Field<T,Dim,M,C>& F) {
00065 TAU_TYPE_STRING(taustr, "DataSourceObject * (char *, DataConnect *, " +
00066 CT(F) + " )");
00067 TAU_PROFILE("make_DataSourceObject()", taustr, TAU_VIZ);
00068
00069
00070 string method(dc->ID());
00071
00072
00073 DataSourceObject *dso = 0;
00074 if (method == "aclvis") {
00075
00076
00077 #ifdef IPPL_ACLVIS
00078 dso = new ACLVISFieldDataSource<T,Dim,M,C>(nm, dc, t, F);
00079 #endif
00080
00081 } else if (method == "paws") {
00082
00083
00084 #ifdef IPPL_PAWS
00085 dso = new PawsFieldDataSource<T,Dim,M,C>(nm, dc, t, F);
00086 #endif
00087
00088 } else if (method == "file") {
00089
00090 dso = new FileFieldDataSource<T,Dim,M,C>(nm, dc, t, F);
00091 }
00092
00093
00094 if (dso == 0)
00095 dso = new DataSourceObject;
00096
00097 return dso;
00098 }
00099
00100
00102
00103 template<class T>
00104 DataSourceObject *
00105 make_DataSourceObject(const char *nm, DataConnect *dc, int t,
00106 ParticleAttrib<T>& P) {
00107 TAU_TYPE_STRING(taustr, "DataSourceObject * (char *, DataConnect *, int, "
00108 + CT(P) + " )");
00109 TAU_PROFILE("make_DataSourceObject()", taustr, TAU_VIZ);
00110
00111
00112 string method(dc->ID());
00113
00114 DataSourceObject *dso = 0;
00115 if (method == "aclvis") {
00116
00117
00118 #ifdef IPPL_ACLVIS
00119 dso = new ACLVISParticleAttribDataSource<T>(nm, dc, t, P);
00120 #endif
00121
00122 } else if (method == "paws") {
00123
00124
00125 #ifdef IPPL_PAWS
00126 dso = new PawsParticleAttribDataSource<T>(nm, dc, t, P);
00127 #endif
00128
00129 } else if (method == "file") {
00130
00131
00132 dso = new FileParticleAttribDataSource<T>(nm, dc, t, P);
00133 }
00134
00135
00136 if (dso == 0)
00137 dso = new DataSourceObject;
00138
00139 return dso;
00140 }
00141
00142
00144
00145 template<class PLayout>
00146 DataSourceObject *
00147 make_DataSourceObject(const char *nm, DataConnect *dc, int t,
00148 ParticleBase<PLayout>& P) {
00149 TAU_TYPE_STRING(taustr, "DataSourceObject * (char *, DataConnect *, int, "
00150 + CT(P) + " )");
00151 TAU_PROFILE("make_DataSourceObject()", taustr, TAU_VIZ);
00152
00153
00154 string method(dc->ID());
00155
00156 DataSourceObject *dso = 0;
00157 if (method == "aclvis") {
00158
00159
00160 #ifdef IPPL_ACLVIS
00161 dso = new ACLVISParticleBaseDataSource<PLayout>(nm, dc, t, P);
00162 #endif
00163
00164 } else if (method == "paws") {
00165
00166
00167
00168 } else if (method == "file") {
00169
00170
00171 dso = new FileParticleBaseDataSource<PLayout>(nm, dc, t, P);
00172 }
00173
00174
00175 if (dso == 0)
00176 dso = new DataSourceObject;
00177
00178 return dso;
00179 }
00180
00182
00183 template<class T>
00184 DataSourceObject *
00185 make_DataSourceObject(const char *nm, DataConnect *dc, int t,
00186 ScalarDataSource<T>& S) {
00187 TAU_TYPE_STRING(taustr, "DataSourceObject * (char *, DataConnect *, int, "
00188 + CT(S) + " )");
00189 TAU_PROFILE("make_DataSourceObject()", taustr, TAU_VIZ);
00190
00191
00192 string method(dc->ID());
00193
00194 DataSourceObject *dso = 0;
00195 if (method == "aclvis") {
00196
00197
00198
00199 } else if (method == "paws") {
00200
00201
00202 #ifdef IPPL_PAWS
00203 dso = new PawsScalarDataSource<T>(nm, dc, t, S);
00204 #endif
00205 } else if (method == "file") {
00206
00207
00208 }
00209
00210
00211 if (dso == 0)
00212 dso = new DataSourceObject;
00213
00214 return dso;
00215 }
00216
00217
00219
00220 template<class T>
00221 DataSourceObject *
00222 make_DataSourceObject(const char *nm, DataConnect *dc, int t,
00223 StringDataSource<T>& S) {
00224 TAU_TYPE_STRING(taustr, "DataSourceObject * (char *, DataConnect *, int, "
00225 + CT(S) + " )");
00226 TAU_PROFILE("make_DataSourceObject()", taustr, TAU_VIZ);
00227
00228
00229 string method(dc->ID());
00230
00231 DataSourceObject *dso = 0;
00232 if (method == "aclvis") {
00233
00234
00235
00236 } else if (method == "paws") {
00237
00238
00239 #ifdef IPPL_PAWS
00240 dso = new PawsStringDataSource<T>(nm, dc, t, S);
00241 #endif
00242 } else if (method == "file") {
00243
00244
00245 }
00246
00247
00248 if (dso == 0)
00249 dso = new DataSourceObject;
00250
00251 return dso;
00252 }
00253
00254
00255
00256
00257
00258