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 PAWS_PARTICLE_ATTRIB_DATA_SOURCE_H 00012 #define PAWS_PARTICLE_ATTRIB_DATA_SOURCE_H 00013 00014 /*********************************************************************** 00015 * 00016 * class PawsParticleAttribDataSource 00017 * 00018 * PawsParticleAttribDataSource is a specific version of 00019 * DataSourceObject which takes the data for a given ParticleAttrib 00020 * and formats it properly for connection to another program via PAWS. 00021 * 00022 ***********************************************************************/ 00023 00024 // include files 00025 #include "DataSource/DataSourceObject.h" 00026 #include "IpplPaws/PawsType.h" 00027 00028 // forward references 00029 template<class T> class ParticleAttrib; 00030 template<class T> class PawsArrayData; 00031 class PawsDataConnect; 00032 00033 00034 template<class T> 00035 class PawsParticleAttribDataSource : public DataSourceObject { 00036 00037 public: 00038 // constructor: the name, the connection, the transfer method, the attrib 00039 PawsParticleAttribDataSource(const char *, DataConnect *, int, 00040 ParticleAttrib<T> &); 00041 00042 // destructor 00043 virtual ~PawsParticleAttribDataSource(); 00044 00045 // 00046 // DataSourceObject virtual function interface. 00047 // 00048 00049 // Update the object, that is, make sure the receiver of the data has a 00050 // current and consistent snapshot of the current state. Return success. 00051 virtual bool update(); 00052 00053 // Indicate to the receiver that we're allowing them time to manipulate the 00054 // data (e.g., for a viz program, to rotate it, change representation, etc.) 00055 // This should only return when the manipulation is done. 00056 virtual void interact(const char * = 0); 00057 00058 private: 00059 // The type and size of the type used for the Paws Array 00060 typedef typename PawsType<T>::Type_t PawsType_t; 00061 enum { Size = PawsType<T>::Size }; 00062 00063 // The particle attrib object 00064 ParticleAttrib<T>& attrib; 00065 00066 // The Paws data structure used to manage the Paws transfer 00067 PawsArrayData<PawsType_t> *pawsArray; 00068 00069 // The connection object we're using here 00070 PawsDataConnect *pawsConnect; 00071 00072 // Size info, one integer for each node 00073 int *sizeinfo; 00074 }; 00075 00076 // Ostream operator expected by Paws 00077 // 00078 template<class T> 00079 ostream& operator<<(ostream& out, const PawsParticleAttribDataSource<T>& attrib); 00080 00081 #include "IpplPaws/PawsPtclAttribDataSource.cpp" 00082 00083 #endif // PAWS_PARTICLE_ATTRIB_DATA_SOURCE_H 00084 00085 /*************************************************************************** 00086 * $RCSfile: PawsPtclAttribDataSource.h,v $ $Author: adelmann $ 00087 * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:32 $ 00088 * IPPL_VERSION_ID: $Id: PawsPtclAttribDataSource.h,v 1.1.1.1 2003/01/23 07:40:32 adelmann Exp $ 00089 ***************************************************************************/