00001 // -*- C++ -*- 00002 /*************************************************************************** 00003 * 00004 * The IPPL Framework 00005 * 00006 * 00007 * Visit http://people.web.psi.ch/adelmann/ for more details 00008 * 00009 ***************************************************************************/ 00010 00011 #ifndef FILE_DATA_CONNECT_H 00012 #define FILE_DATA_CONNECT_H 00013 00014 /*********************************************************************** 00015 * 00016 * FileDataConnect represents a single connection to a parallel datafile 00017 * object (such as DiskField) 00018 * 00019 ***********************************************************************/ 00020 00021 // include files 00022 #include "DataSource/DataConnect.h" 00023 #include "Utility/Pstring.h" 00024 00025 00026 class FileDataConnect : public DataConnect { 00027 00028 public: 00029 // constructor: file name, items in the file, typestring, nodes 00030 FileDataConnect(const char *nm, unsigned int numobjs = 1, const char *ts = 0, 00031 int n = 0) 00032 : DataConnect(nm, "file", DataSource::OUTPUT, n), NumObjects(numobjs) { 00033 if (ts == 0) 00034 TypeString = "unknown"; 00035 else 00036 TypeString = ts; 00037 } 00038 00039 // destructor: shut down the connection 00040 virtual ~FileDataConnect() {} 00041 00042 // 00043 // methods specific to this type of DataConnect 00044 // 00045 00046 // return number of objects that this file should hold 00047 unsigned int getNumObjects() const { return NumObjects; } 00048 00049 // return the type string for this file 00050 const char* getTypeString() const { return TypeString.c_str(); } 00051 00052 // 00053 // DataConnect virtual methods 00054 // 00055 00056 // are we currently connected to a receiver? 00057 virtual bool connected() const { return true; } 00058 00059 private: 00060 // number of objects in the file, and a type string 00061 unsigned int NumObjects; 00062 string TypeString; 00063 }; 00064 00065 #endif // FILE_DATA_CONNECT_H 00066 00067 /*************************************************************************** 00068 * $RCSfile: FileDataConnect.h,v $ $Author: adelmann $ 00069 * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:25 $ 00070 * IPPL_VERSION_ID: $Id: FileDataConnect.h,v 1.1.1.1 2003/01/23 07:40:25 adelmann Exp $ 00071 ***************************************************************************/