Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

src/DataSource/StringDataSource.cpp

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 /***************************************************************************
00003  *
00004  * The IPPL Framework
00005  * 
00006  * This program was prepared by PSI. 
00007  * All rights in the program are reserved by PSI.
00008  * Neither PSI nor the author(s)
00009  * makes any warranty, express or implied, or assumes any liability or
00010  * responsibility for the use of this software
00011  *
00012  * Visit http://www.acl.lanl.gov/POOMS for more details
00013  *
00014  ***************************************************************************/
00015 
00016 // -*- C++ -*-
00017 /***************************************************************************
00018  *
00019  * The IPPL Framework
00020  * 
00021  *
00022  * Visit http://people.web.psi.ch/adelmann/ for more details
00023  *
00024  ***************************************************************************/
00025 
00026 // include files
00027 #include "DataSource/DataSourceObject.h"
00028 #include "DataSource/DataConnect.h"
00029 #include "Utility/Pstring.h"
00030 #include "Profile/Profiler.h"
00031 
00032 #ifdef IPPL_PAWS
00033 #include "IpplPaws/PawsStringDataSource.h"
00034 #endif
00035 
00036 
00038 // a virtual function which is called by this base class to get a
00039 // specific instance of DataSourceObject based on the type of data
00040 // and the connection method (the argument to the call).
00041 template <class T>
00042 DataSourceObject *StringDataSource<T>::createDataSourceObject(const char *nm,
00043                                                            DataConnect *dc,
00044                                                            int tm) {
00045   TAU_TYPE_STRING(taustr, "DataSourceObject * (char *, DataConnect *, int)");
00046   TAU_PROFILE("make_DataSourceObject()", taustr, TAU_VIZ);
00047 
00048   // get the connection method name, and make a string out of it
00049   string method(dc->ID());
00050 
00051   DataSourceObject *dso = 0;
00052   if (method == "aclvis") {
00053     // create a DataSourceObject for this ParticleBase which will connect to
00054     // the ACL visualization code
00055 
00056   } else if (method == "paws") {
00057     // create a DataSourceObject for this ParticleAttrib which will connect to
00058     // another PAWS application
00059 #ifdef IPPL_PAWS
00060     dso = new PawsStringDataSource<T>(nm, dc, tm, *this);
00061 #endif
00062   } else if (method == "file") {
00063     // create a DataSourceObject for this FILE which will connect to
00064     // a file
00065   }
00066 
00067   // make a default connection is nothing has been found
00068   if (dso == 0)
00069     dso = new DataSourceObject;
00070 
00071   return dso;
00072 }
00073 
00074 
00075 /***************************************************************************
00076  * $RCSfile: StringDataSource.cpp,v $   $Author: adelmann $
00077  * $Revision: 1.1.1.1 $   $Date: 2003/01/23 07:40:25 $
00078  * IPPL_VERSION_ID: $Id: StringDataSource.cpp,v 1.1.1.1 2003/01/23 07:40:25 adelmann Exp $ 
00079  ***************************************************************************/

Generated on Fri Nov 2 01:25:55 2007 for IPPL by doxygen 1.3.5