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_SCALAR_DATA_SOURCE_H 00012 #define PAWS_SCALAR_DATA_SOURCE_H 00013 00014 /*********************************************************************** 00015 * 00016 * class PawsScalarDataSource 00017 * 00018 * PawsScalarDataSource is a specific version of DataSourceObject connects 00019 * with a Paws application 00020 * 00021 ***********************************************************************/ 00022 00023 // include files 00024 #include "DataSource/DataSourceObject.h" 00025 00026 // forward references 00027 template<class T> class ScalarDataSource; 00028 template<class T> class PawsScalarData; 00029 class PawsDataConnect; 00030 00031 00032 template<class T> 00033 class PawsScalarDataSource : public DataSourceObject { 00034 00035 public: 00036 00037 // constructor: the name, the connection, the transfer method, 00038 // the scalar to connect, and the parent node. 00039 PawsScalarDataSource(const char *, DataConnect *, int, ScalarDataSource<T>&); 00040 00041 // destructor 00042 virtual ~PawsScalarDataSource(); 00043 00044 // 00045 // virtual function interface. 00046 // 00047 00048 // Register an object as something that can be a source of data. 00049 00050 00051 // Update the object, that is, make sure the receiver of the data has a 00052 // current and consistent snapshot of the current state. Return success. 00053 virtual bool update(); 00054 00055 // Indicate to the receiver that we're allowing them time to manipulate the 00056 // data (e.g., for a viz program, to rotate it, change representation, etc.) 00057 // This should only return when the manipulation is done. 00058 virtual void interact(const char * = 0); 00059 00060 private: 00061 // DataSource Object 00062 ScalarDataSource<T> &scalarDataSource; 00063 00064 // Scalar 00065 T &myScalar; 00066 00067 // The Paws scalar data object used to send/receive data 00068 PawsScalarData<T> *pawsdata; 00069 00070 // The connection object we're using here 00071 PawsDataConnect *pdc; 00072 }; 00073 00074 #include "IpplPaws/PawsScalarDataSource.cpp" 00075 00076 #endif // PAWS_SCALAR_DATA_SOURCE_H 00077 00078 /*************************************************************************** 00079 * $RCSfile: PawsScalarDataSource.h,v $ $Author: adelmann $ 00080 * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:32 $ 00081 * IPPL_VERSION_ID: $Id: PawsScalarDataSource.h,v 1.1.1.1 2003/01/23 07:40:32 adelmann Exp $ 00082 ***************************************************************************/